From f483df8a94ef57a3c305797ac13cdd4be0cd376c Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Fri, 26 Aug 2005 11:49:38 +0000 Subject: Remove dependency on math.h --- src/configuration.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/configuration.cpp b/src/configuration.cpp index 0b43418f..f961c084 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -24,7 +24,6 @@ #include "configuration.h" -#include #include #include @@ -136,30 +135,20 @@ void Configuration::setValue(const std::string &key, std::string value) void Configuration::setValue(const std::string &key, float value) { std::stringstream ss; - if (value == floor(value)) { - ss << (int)value; - } else { - ss << value; - } + ss << ((value == (int)value) ? (int)value : value); setValue(key, ss.str()); } std::string Configuration::getValue(const std::string &key, std::string deflt) { std::map::iterator iter = options.find(key); - if (iter != options.end()) { - return (*iter).second; - } - return deflt; + return ((iter != options.end()) ? (*iter).second : deflt); } float Configuration::getValue(const std::string &key, float deflt) { std::map::iterator iter = options.find(key); - if (iter != options.end()) { - return atof((*iter).second.c_str()); - } - return deflt; + return (iter != options.end()) ? atof((*iter).second.c_str()) : deflt; } void Configuration::addListener( -- cgit v1.2.3-70-g09d2