diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-24T21·29+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-24T21·29+0100 |
commit | 838f86b0fd880b26539664140f04e5d16669dad8 (patch) | |
tree | c8fee2f0c136fbe5bb0735604e2f04d5b02698ba /third_party/nix/src/libstore/machines.cc | |
parent | f30b2e610d9e612504a9f6460e0cc83413b80aeb (diff) |
style(3p/nix): Remove 'using std::*' from types.hh r/840
It is considered bad form to use things from includes in headers, as these directives propagate to everywhere else and can make it confusing. types.hh (which is includes almost literally everywhere) had some of these directives, which this commit removes.
Diffstat (limited to 'third_party/nix/src/libstore/machines.cc')
-rw-r--r-- | third_party/nix/src/libstore/machines.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/third_party/nix/src/libstore/machines.cc b/third_party/nix/src/libstore/machines.cc index 5b0c7e72ddba..2f1a7289bd84 100644 --- a/third_party/nix/src/libstore/machines.cc +++ b/third_party/nix/src/libstore/machines.cc @@ -32,22 +32,22 @@ Machine::Machine(decltype(storeUri)& storeUri, mandatoryFeatures(mandatoryFeatures), sshPublicHostKey(sshPublicHostKey) {} -bool Machine::allSupported(const std::set<string>& features) const { +bool Machine::allSupported(const std::set<std::string>& features) const { return std::all_of(features.begin(), features.end(), - [&](const string& feature) { + [&](const std::string& feature) { return (supportedFeatures.count(feature) != 0u) || (mandatoryFeatures.count(feature) != 0u); }); } -bool Machine::mandatoryMet(const std::set<string>& features) const { +bool Machine::mandatoryMet(const std::set<std::string>& features) const { return std::all_of( mandatoryFeatures.begin(), mandatoryFeatures.end(), - [&](const string& feature) { return features.count(feature); }); + [&](const std::string& feature) { return features.count(feature); }); } void parseMachines(const std::string& s, Machines& machines) { - for (auto line : tokenizeString<std::vector<string>>(s, "\n;")) { + for (auto line : tokenizeString<std::vector<std::string>>(s, "\n;")) { trim(line); line.erase(std::find(line.begin(), line.end(), '#'), line.end()); if (line.empty()) { @@ -67,7 +67,7 @@ void parseMachines(const std::string& s, Machines& machines) { continue; } - auto tokens = tokenizeString<std::vector<string>>(line); + auto tokens = tokenizeString<std::vector<std::string>>(line); auto sz = tokens.size(); if (sz < 1) { throw FormatError("bad machine specification '%s'", line); @@ -79,14 +79,14 @@ void parseMachines(const std::string& s, Machines& machines) { machines.emplace_back( tokens[0], - isSet(1) ? tokenizeString<std::vector<string>>(tokens[1], ",") - : std::vector<string>{settings.thisSystem}, + isSet(1) ? tokenizeString<std::vector<std::string>>(tokens[1], ",") + : std::vector<std::string>{settings.thisSystem}, isSet(2) ? tokens[2] : "", isSet(3) ? std::stoull(tokens[3]) : 1LL, isSet(4) ? std::stoull(tokens[4]) : 1LL, - isSet(5) ? tokenizeString<std::set<string>>(tokens[5], ",") - : std::set<string>{}, - isSet(6) ? tokenizeString<std::set<string>>(tokens[6], ",") - : std::set<string>{}, + isSet(5) ? tokenizeString<std::set<std::string>>(tokens[5], ",") + : std::set<std::string>{}, + isSet(6) ? tokenizeString<std::set<std::string>>(tokens[6], ",") + : std::set<std::string>{}, isSet(7) ? tokens[7] : ""); } } |