From 0189bbc6bc727d161b9adcd2fa82f6c573bbf0a7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 19 May 2008 10:25:38 +0000 Subject: 2008-05-19 Tatsuhiro Tsujikawa Defined option name and possible values as std::string to reduce temporary string object creation in runtime. * src/HelpItemFactory.cc * src/LogFactory.cc * src/Option.cc * src/OptionHandlerFactory.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h --- src/LogFactory.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/LogFactory.cc') diff --git a/src/LogFactory.cc b/src/LogFactory.cc index e67487eb..baaf42dd 100644 --- a/src/LogFactory.cc +++ b/src/LogFactory.cc @@ -67,15 +67,15 @@ void LogFactory::setLogLevel(Logger::LEVEL level) void LogFactory::setLogLevel(const std::string& level) { - if(strcmp(level.c_str(), V_DEBUG) == 0) { + if(level == V_DEBUG) { _logLevel = Logger::DEBUG; - } else if(strcmp(level.c_str(), V_INFO) == 0) { + } else if(level == V_INFO) { _logLevel = Logger::INFO; - } else if(strcmp(level.c_str(), V_NOTICE) == 0) { + } else if(level == V_NOTICE) { _logLevel = Logger::NOTICE; - } else if(strcmp(level.c_str(), V_WARN) == 0) { + } else if(level == V_WARN) { _logLevel = Logger::WARN; - } else if(strcmp(level.c_str(), V_ERROR) == 0) { + } else if(level == V_ERROR) { _logLevel = Logger::ERROR; } } -- cgit