about summary refs log tree commit diff
path: root/third_party/nix/src/nix/upgrade-nix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix/upgrade-nix.cc')
-rw-r--r--third_party/nix/src/nix/upgrade-nix.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/nix/src/nix/upgrade-nix.cc b/third_party/nix/src/nix/upgrade-nix.cc
index dd11da0087c7..b225aac2d725 100644
--- a/third_party/nix/src/nix/upgrade-nix.cc
+++ b/third_party/nix/src/nix/upgrade-nix.cc
@@ -52,7 +52,7 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand {
   void run(ref<Store> store) override {
     evalSettings.pureEval = true;
 
-    if (profileDir == "") {
+    if (profileDir.empty()) {
       profileDir = getProfileDir(store);
     }
 
@@ -97,7 +97,7 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand {
   }
 
   /* Return the profile in which Nix is installed. */
-  Path getProfileDir(ref<Store> store) {
+  static Path getProfileDir(ref<Store> store) {
     Path where;
 
     for (auto& dir : tokenizeString<Strings>(getEnv("PATH"), ":")) {
@@ -107,7 +107,7 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand {
       }
     }
 
-    if (where == "") {
+    if (where.empty()) {
       throw Error(
           "couldn't figure out how Nix is installed, so I can't upgrade it");
     }