diff options
Diffstat (limited to 'src/nix-env/names.cc')
-rw-r--r-- | src/nix-env/names.cc | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/nix-env/names.cc b/src/nix-env/names.cc index c6054d6c1bef..93bcfda24e60 100644 --- a/src/nix-env/names.cc +++ b/src/nix-env/names.cc @@ -56,20 +56,10 @@ static string nextComponent(string::const_iterator & p, } -#include <fstream> - -static bool parseInt(const string & s, int & n) -{ - istringstream st(s); - st >> n; - return !st.fail(); -} - - static bool componentsLT(const string & c1, const string & c2) { int n1, n2; - bool c1Num = parseInt(c1, n1), c2Num = parseInt(c2, n2); + bool c1Num = string2Int(c1, n1), c2Num = string2Int(c2, n2); if (c1Num && c2Num) return n1 < n2; else if (c1 == "" && c2Num) return true; |