about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/names.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-24T21·29+0100
committerVincent Ambo <tazjin@google.com>2020-05-24T21·29+0100
commit838f86b0fd880b26539664140f04e5d16669dad8 (patch)
treec8fee2f0c136fbe5bb0735604e2f04d5b02698ba /third_party/nix/src/libexpr/names.cc
parentf30b2e610d9e612504a9f6460e0cc83413b80aeb (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/libexpr/names.cc')
-rw-r--r--third_party/nix/src/libexpr/names.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/third_party/nix/src/libexpr/names.cc b/third_party/nix/src/libexpr/names.cc
index ac8150532f25..20c326776cb7 100644
--- a/third_party/nix/src/libexpr/names.cc
+++ b/third_party/nix/src/libexpr/names.cc
@@ -18,8 +18,8 @@ DrvName::DrvName(const std::string& s) : hits(0) {
   for (unsigned int i = 0; i < s.size(); ++i) {
     /* !!! isalpha/isdigit are affected by the locale. */
     if (s[i] == '-' && i + 1 < s.size() && (isalpha(s[i + 1]) == 0)) {
-      name = string(s, 0, i);
-      version = string(s, i + 1);
+      name = std::string(s, 0, i);
+      version = std::string(s, i + 1);
       break;
     }
   }
@@ -37,8 +37,8 @@ bool DrvName::matches(DrvName& n) {
   return !(!version.empty() && version != n.version);
 }
 
-string nextComponent(string::const_iterator& p,
-                     const string::const_iterator end) {
+std::string nextComponent(std::string::const_iterator& p,
+                          const std::string::const_iterator end) {
   /* Skip any dots and dashes (component separators). */
   while (p != end && (*p == '.' || *p == '-')) {
     ++p;
@@ -91,8 +91,8 @@ static bool componentsLT(const std::string& c1, const std::string& c2) {
 }
 
 int compareVersions(const std::string& v1, const std::string& v2) {
-  string::const_iterator p1 = v1.begin();
-  string::const_iterator p2 = v2.begin();
+  std::string::const_iterator p1 = v1.begin();
+  std::string::const_iterator p2 = v2.begin();
 
   while (p1 != v1.end() || p2 != v2.end()) {
     std::string c1 = nextComponent(p1, v1.end());