diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-03-17 19:14:18 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-03-17 20:17:19 -0700 |
commit | 61e21b25576f7f3491f6a837bf59d8b44c6897a0 (patch) | |
tree | 3f62d83b3bab84afcf1011b5c2353226b84313b3 /src/libutil/split.hh | |
parent | 706cee5c493b39e25bdb0add55d2e1771dc31696 (diff) |
Delete hasPrefix and hasSuffix from the codebase
These now have equivalents in the standard lib in C++20. This change was
performed with a custom clang-tidy check which I will submit later.
Executed like so:
ninja -C build && run-clang-tidy -checks='-*,nix-*' -load=build/libnix-clang-tidy.so -p .. -fix ../tests | tee -a clang-tidy-result
Change-Id: I62679e315ff9e7ce72a40b91b79c3e9fc01b27e9
Diffstat (limited to 'src/libutil/split.hh')
-rw-r--r-- | src/libutil/split.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/split.hh b/src/libutil/split.hh index 3b9b2b83b..4ff940eef 100644 --- a/src/libutil/split.hh +++ b/src/libutil/split.hh @@ -27,7 +27,7 @@ static inline std::optional<std::string_view> splitPrefixTo(std::string_view & s } static inline bool splitPrefix(std::string_view & string, std::string_view prefix) { - bool res = hasPrefix(string, prefix); + bool res = string.starts_with(prefix); if (res) string.remove_prefix(prefix.length()); return res; |