From ebfe57166dcf14b0033b4f3d3be3bb1289a19c07 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Sep 2005 17:23:43 +0000 Subject: [PATCH] * Lets not go wild with templates. --- src/libstore/globals.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 9a3ac6981..ef87e3ba8 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -26,9 +26,9 @@ static bool settingsRead = false; static map settings; -template A & genericAt(T & container, unsigned int n) +string & at(Strings & ss, unsigned int n) { - class T::iterator i = container.begin(); + Strings::iterator i =ss.begin(); advance(i, n); return *i; } @@ -55,10 +55,10 @@ static void readSettings() Strings tokens = tokenizeString(line); if (tokens.empty()) continue; - if (tokens.size() < 2 || genericAt(tokens, 1) != "=") + if (tokens.size() < 2 || at(tokens, 1) != "=") throw Error(format("illegal configuration line `%1%' in `%2%'") % line % settingsFile); - string name = genericAt(tokens, 0); + string name = at(tokens, 0); Strings::iterator i = tokens.begin(); advance(i, 2); @@ -79,6 +79,8 @@ Strings querySetting(const string & name, const Strings & def) bool queryBoolSetting(const string & name, bool def) { + debug("X"); + Strings defs; if (def) defs.push_back("true"); else defs.push_back("false");