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/resolve-system-dependencies/resolve-system-dependencies.cc | |
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/resolve-system-dependencies/resolve-system-dependencies.cc')
-rw-r--r-- | src/resolve-system-dependencies/resolve-system-dependencies.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc index 4ea268d24..424c789d8 100644 --- a/src/resolve-system-dependencies/resolve-system-dependencies.cc +++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc @@ -105,7 +105,7 @@ bool isSymlink(const Path & path) Path resolveSymlink(const Path & path) { auto target = readLink(path); - return hasPrefix(target, "/") + return target.starts_with("/") ? target : concatStrings(dirOf(path), "/", target); } @@ -125,7 +125,7 @@ std::set<std::string> resolveTree(const Path & path, PathSet & deps) std::set<std::string> getPath(const Path & path) { - if (hasPrefix(path, "/dev")) return {}; + if (path.starts_with("/dev")) return {}; Path cacheFile = resolveCacheFile(path); if (pathExists(cacheFile)) |