diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-19 10:25:38 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-19 10:25:38 +0000 |
| commit | 0189bbc6bc727d161b9adcd2fa82f6c573bbf0a7 (patch) | |
| tree | 9ac9851562949b00e241fbed96358791338910c2 /src/OptionHandlerFactory.cc | |
| parent | e59f4f2fe3280b86c76fe5424d171e3e33113beb (diff) | |
2008-05-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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
Diffstat (limited to 'src/OptionHandlerFactory.cc')
| -rw-r--r-- | src/OptionHandlerFactory.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index 9e9579cc..a68b4ed0 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -112,9 +112,9 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() handlers.push_back(SH(new BooleanOptionHandler(PREF_ENABLE_DIRECT_IO))); handlers.push_back(SH(new BooleanOptionHandler(PREF_ALLOW_PIECE_LENGTH_CHANGE))); { - const char* params[] = { V_HTTP, V_HTTPS, V_FTP, V_NONE }; + const std::string params[] = { V_HTTP, V_HTTPS, V_FTP, V_NONE }; handlers.push_back(SH(new ParameterOptionHandler(PREF_METALINK_PREFERRED_PROTOCOL, - std::deque<std::string>(¶ms[0], ¶ms[arrayLength(params)])))); + std::deque<std::string>(¶ms[0], ¶ms[arrayLength(params)])))); } handlers.push_back(SH(new BooleanOptionHandler(PREF_METALINK_ENABLE_UNIQUE_PROTOCOL))); handlers.push_back(SH(new BooleanOptionHandler(PREF_ENABLE_PEER_EXCHANGE))); @@ -134,7 +134,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() handlers.push_back(SH(new BooleanOptionHandler(PREF_FTP_REUSE_CONNECTION))); handlers.push_back(SH(new NumberOptionHandler(PREF_SUMMARY_INTERVAL, 0, INT32_MAX))); { - const char* params[] = { V_DEBUG, V_INFO, V_NOTICE, V_WARN, V_ERROR }; + const std::string params[] = { V_DEBUG, V_INFO, V_NOTICE, V_WARN, V_ERROR }; handlers.push_back(SH(new ParameterOptionHandler (PREF_LOG_LEVEL, std::deque<std::string>(¶ms[0], |
