guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

87/118: Refactor


From: Ludovic Courtès
Subject: 87/118: Refactor
Date: Tue, 19 May 2015 14:45:52 +0000

civodul pushed a commit to branch nix
in repository guix.

commit 31909515634d74e4c3d92be6186c5c48244582ae
Author: Eelco Dolstra <address@hidden>
Date:   Mon Aug 4 18:02:29 2014 +0200

    Refactor
---
 nix/libstore/build.cc   |    4 +-
 nix/libstore/globals.cc |   72 +++++++++++++++++++++++-----------------------
 nix/libstore/globals.hh |   10 +++---
 3 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index c73170e..b207ade 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1804,8 +1804,8 @@ void DerivationGoal::startBuilder()
 
         /* Bind-mount a user-configurable set of directories from the
            host file system. */
-        PathSet dirs = 
tokenizeString<StringSet>(settings.get(string("build-chroot-dirs"), 
DEFAULT_CHROOT_DIRS));
-        PathSet dirs2 = 
tokenizeString<StringSet>(settings.get(string("build-extra-chroot-dirs"), ""));
+        PathSet dirs = 
tokenizeString<StringSet>(settings.get("build-chroot-dirs", 
DEFAULT_CHROOT_DIRS));
+        PathSet dirs2 = 
tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", ""));
         dirs.insert(dirs2.begin(), dirs2.end());
         for (auto & i : dirs) {
             size_t p = i.find('=');
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index b4c858b..9da14dc 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -118,37 +118,37 @@ void Settings::set(const string & name, const string & 
value)
 
 void Settings::update()
 {
-    get(tryFallback, "build-fallback");
-    get(maxBuildJobs, "build-max-jobs");
-    get(buildCores, "build-cores");
-    get(thisSystem, "system");
-    get(maxSilentTime, "build-max-silent-time");
-    get(buildTimeout, "build-timeout");
-    get(reservedSize, "gc-reserved-space");
-    get(fsyncMetadata, "fsync-metadata");
-    get(useSQLiteWAL, "use-sqlite-wal");
-    get(syncBeforeRegistering, "sync-before-registering");
-    get(useSubstitutes, "build-use-substitutes");
-    get(buildUsersGroup, "build-users-group");
-    get(useChroot, "build-use-chroot");
-    get(impersonateLinux26, "build-impersonate-linux-26");
-    get(keepLog, "build-keep-log");
-    get(compressLog, "build-compress-log");
-    get(maxLogSize, "build-max-log-size");
-    get(cacheFailure, "build-cache-failure");
-    get(pollInterval, "build-poll-interval");
-    get(checkRootReachability, "gc-check-reachability");
-    get(gcKeepOutputs, "gc-keep-outputs");
-    get(gcKeepDerivations, "gc-keep-derivations");
-    get(autoOptimiseStore, "auto-optimise-store");
-    get(envKeepDerivations, "env-keep-derivations");
-    get(sshSubstituterHosts, "ssh-substituter-hosts");
-    get(useSshSubstituter, "use-ssh-substituter");
-    get(logServers, "log-servers");
-    get(enableImportNative, "allow-unsafe-native-code-during-evaluation");
-    get(useCaseHack, "use-case-hack");
-    get(trustedUsers, "trusted-users");
-    get(allowedUsers, "allowed-users");
+    _get(tryFallback, "build-fallback");
+    _get(maxBuildJobs, "build-max-jobs");
+    _get(buildCores, "build-cores");
+    _get(thisSystem, "system");
+    _get(maxSilentTime, "build-max-silent-time");
+    _get(buildTimeout, "build-timeout");
+    _get(reservedSize, "gc-reserved-space");
+    _get(fsyncMetadata, "fsync-metadata");
+    _get(useSQLiteWAL, "use-sqlite-wal");
+    _get(syncBeforeRegistering, "sync-before-registering");
+    _get(useSubstitutes, "build-use-substitutes");
+    _get(buildUsersGroup, "build-users-group");
+    _get(useChroot, "build-use-chroot");
+    _get(impersonateLinux26, "build-impersonate-linux-26");
+    _get(keepLog, "build-keep-log");
+    _get(compressLog, "build-compress-log");
+    _get(maxLogSize, "build-max-log-size");
+    _get(cacheFailure, "build-cache-failure");
+    _get(pollInterval, "build-poll-interval");
+    _get(checkRootReachability, "gc-check-reachability");
+    _get(gcKeepOutputs, "gc-keep-outputs");
+    _get(gcKeepDerivations, "gc-keep-derivations");
+    _get(autoOptimiseStore, "auto-optimise-store");
+    _get(envKeepDerivations, "env-keep-derivations");
+    _get(sshSubstituterHosts, "ssh-substituter-hosts");
+    _get(useSshSubstituter, "use-ssh-substituter");
+    _get(logServers, "log-servers");
+    _get(enableImportNative, "allow-unsafe-native-code-during-evaluation");
+    _get(useCaseHack, "use-case-hack");
+    _get(trustedUsers, "trusted-users");
+    _get(allowedUsers, "allowed-users");
 
     string subs = getEnv("NIX_SUBSTITUTERS", "default");
     if (subs == "default") {
@@ -166,7 +166,7 @@ void Settings::update()
 }
 
 
-void Settings::get(string & res, const string & name)
+void Settings::_get(string & res, const string & name)
 {
     SettingsMap::iterator i = settings.find(name);
     if (i == settings.end()) return;
@@ -174,7 +174,7 @@ void Settings::get(string & res, const string & name)
 }
 
 
-void Settings::get(bool & res, const string & name)
+void Settings::_get(bool & res, const string & name)
 {
     SettingsMap::iterator i = settings.find(name);
     if (i == settings.end()) return;
@@ -185,7 +185,7 @@ void Settings::get(bool & res, const string & name)
 }
 
 
-void Settings::get(StringSet & res, const string & name)
+void Settings::_get(StringSet & res, const string & name)
 {
     SettingsMap::iterator i = settings.find(name);
     if (i == settings.end()) return;
@@ -194,7 +194,7 @@ void Settings::get(StringSet & res, const string & name)
     res.insert(ss.begin(), ss.end());
 }
 
-void Settings::get(Strings & res, const string & name)
+void Settings::_get(Strings & res, const string & name)
 {
     SettingsMap::iterator i = settings.find(name);
     if (i == settings.end()) return;
@@ -202,7 +202,7 @@ void Settings::get(Strings & res, const string & name)
 }
 
 
-template<class N> void Settings::get(N & res, const string & name)
+template<class N> void Settings::_get(N & res, const string & name)
 {
     SettingsMap::iterator i = settings.find(name);
     if (i == settings.end()) return;
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index 7a81283..df113e2 100644
--- a/nix/libstore/globals.hh
+++ b/nix/libstore/globals.hh
@@ -211,11 +211,11 @@ struct Settings {
 private:
     SettingsMap settings, overrides;
 
-    void get(string & res, const string & name);
-    void get(bool & res, const string & name);
-    void get(StringSet & res, const string & name);
-    void get(Strings & res, const string & name);
-    template<class N> void get(N & res, const string & name);
+    void _get(string & res, const string & name);
+    void _get(bool & res, const string & name);
+    void _get(StringSet & res, const string & name);
+    void _get(Strings & res, const string & name);
+    template<class N> void _get(N & res, const string & name);
 };
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]