aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/machines.cc
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-03-17 19:14:18 -0700
committerJade Lovelace <lix@jade.fyi>2024-03-17 20:17:19 -0700
commit61e21b25576f7f3491f6a837bf59d8b44c6897a0 (patch)
tree3f62d83b3bab84afcf1011b5c2353226b84313b3 /src/libstore/machines.cc
parent706cee5c493b39e25bdb0add55d2e1771dc31696 (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/libstore/machines.cc')
-rw-r--r--src/libstore/machines.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc
index f808b8592..ecae3054e 100644
--- a/src/libstore/machines.cc
+++ b/src/libstore/machines.cc
@@ -24,10 +24,10 @@ Machine::Machine(decltype(storeUri) storeUri,
|| storeUri == "auto"
|| storeUri == "daemon"
|| storeUri == "local"
- || hasPrefix(storeUri, "auto?")
- || hasPrefix(storeUri, "daemon?")
- || hasPrefix(storeUri, "local?")
- || hasPrefix(storeUri, "?")
+ || storeUri.starts_with("auto?")
+ || storeUri.starts_with("daemon?")
+ || storeUri.starts_with("local?")
+ || storeUri.starts_with("?")
? storeUri
: "ssh://" + storeUri),
systemTypes(systemTypes),
@@ -67,12 +67,12 @@ bool Machine::mandatoryMet(const std::set<std::string> & features) const
ref<Store> Machine::openStore() const
{
Store::Params storeParams;
- if (hasPrefix(storeUri, "ssh://")) {
+ if (storeUri.starts_with("ssh://")) {
storeParams["max-connections"] = "1";
storeParams["log-fd"] = "4";
}
- if (hasPrefix(storeUri, "ssh://") || hasPrefix(storeUri, "ssh-ng://")) {
+ if (storeUri.starts_with("ssh://") || storeUri.starts_with("ssh-ng://")) {
if (sshKey != "")
storeParams["ssh-key"] = sshKey;
if (sshPublicHostKey != "")