diff options
author | 2014-03-29 15:02:59 +0100 | |
---|---|---|
committer | 2015-05-01 14:06:21 +0100 | |
commit | 85d89c12188201297828c92ae60655ac93626361 (patch) | |
tree | 6bb5c3b442427782afb6d172cbb9866a30f7f010 /paludis | |
parent | 092d6b1323fce831f60bee5f5c7f0be9b2c3aadb (diff) | |
download | paludis-85d89c12188201297828c92ae60655ac93626361.tar.gz paludis-85d89c12188201297828c92ae60655ac93626361.tar.xz |
Make bool destringify check for failbit.
To reduce code duplication it's implemented in terms of int destringify.
Change-Id: I2b681b118178f13bd3d2f711b65a82767d834fd9
Diffstat (limited to 'paludis')
-rw-r--r-- | paludis/util/destringify.hh | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/paludis/util/destringify.hh b/paludis/util/destringify.hh index cf09b7ea6..1a97d014c 100644 --- a/paludis/util/destringify.hh +++ b/paludis/util/destringify.hh @@ -121,15 +121,7 @@ namespace paludis else if (s == "false") return false; else - { - std::istringstream ss(s); - int i; - ss >> i; - if (ss.eof() && ! ss.bad()) - return i > 0; - else - throw Exception_(s); - } + return Destringifier<int, Exception_>::do_destringify(s) > 0; } }; |