diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-25T19·38-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-25T19·38-0400 |
commit | e464b0247d9dd2c53770a851956dd34f82b7c9a6 (patch) | |
tree | 75517243f3ce6c5facd3e2424fefbaeeaaad1af1 /src/libstore/globals.cc | |
parent | 28bf183d2d2f775e653efe4cee98d7359ce65455 (diff) | |
parent | b9c2b4d5b4cd5d52a950e6dd90eb2e2e79891fa0 (diff) |
Merge branch 'readonly-store'
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 7e2624bbf712..9b22d54508c1 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -65,15 +65,7 @@ void Settings::processEnvironment() substituters.push_back(nixLibexecDir + "/nix/substituters/download-using-manifests.pl"); substituters.push_back(nixLibexecDir + "/nix/substituters/download-from-binary-cache.pl"); } else - substituters = tokenizeString(subs, ":"); -} - - -string & at(Strings & ss, unsigned int n) -{ - Strings::iterator i = ss.begin(); - advance(i, n); - return *i; + substituters = tokenizeString<Strings>(subs, ":"); } @@ -95,15 +87,15 @@ void Settings::loadConfFile() if (hash != string::npos) line = string(line, 0, hash); - Strings tokens = tokenizeString(line); + vector<string> tokens = tokenizeString<vector<string> >(line); if (tokens.empty()) continue; - if (tokens.size() < 2 || at(tokens, 1) != "=") + if (tokens.size() < 2 || tokens[1] != "=") throw Error(format("illegal configuration line `%1%' in `%2%'") % line % settingsFile); - string name = at(tokens, 0); + string name = tokens[0]; - Strings::iterator i = tokens.begin(); + vector<string>::iterator i = tokens.begin(); advance(i, 2); settings[name] = concatStringsSep(" ", Strings(i, tokens.end())); // FIXME: slow }; @@ -170,7 +162,7 @@ void Settings::get(PathSet & res, const string & name) SettingsMap::iterator i = settings.find(name); if (i == settings.end()) return; res.clear(); - Strings ss = tokenizeString(i->second); + Strings ss = tokenizeString<Strings>(i->second); res.insert(ss.begin(), ss.end()); } |