From 8558457143bfa76d61e0d2f715e40ec2ddb6ffc2 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Fri, 26 Sep 2014 19:32:46 +0200 Subject: [PATCH] ldb_cmd_execute_result.h: perform init in initialization list Fix for: [util/ldb_cmd_execute_result.h:18]: (performance) Variable 'message_' is assigned in constructor body. Consider performing initialization in initialization list. [util/ldb_cmd_execute_result.h:23]: (performance) Variable 'message_' is assigned in constructor body. Consider performing initialization in initialization list. Signed-off-by: Danny Al-Gaaf --- util/ldb_cmd_execute_result.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/util/ldb_cmd_execute_result.h b/util/ldb_cmd_execute_result.h index b9121b2b0..b8e6c4634 100644 --- a/util/ldb_cmd_execute_result.h +++ b/util/ldb_cmd_execute_result.h @@ -13,15 +13,10 @@ public: EXEC_NOT_STARTED = 0, EXEC_SUCCEED = 1, EXEC_FAILED = 2, }; - LDBCommandExecuteResult() { - state_ = EXEC_NOT_STARTED; - message_ = ""; - } + LDBCommandExecuteResult() : state_(EXEC_NOT_STARTED), message_("") {} - LDBCommandExecuteResult(State state, std::string& msg) { - state_ = state; - message_ = msg; - } + LDBCommandExecuteResult(State state, std::string& msg) : + state_(state), message_(msg) {} std::string ToString() { std::string ret;