Skip to content

Commit 8558457

Browse files
committed
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 <danny.al-gaaf@bisect.de>
1 parent 063471b commit 8558457

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

util/ldb_cmd_execute_result.h

+3-8
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@ class LDBCommandExecuteResult {
1313
EXEC_NOT_STARTED = 0, EXEC_SUCCEED = 1, EXEC_FAILED = 2,
1414
};
1515

16-
LDBCommandExecuteResult() {
17-
state_ = EXEC_NOT_STARTED;
18-
message_ = "";
19-
}
16+
LDBCommandExecuteResult() : state_(EXEC_NOT_STARTED), message_("") {}
2017

21-
LDBCommandExecuteResult(State state, std::string& msg) {
22-
state_ = state;
23-
message_ = msg;
24-
}
18+
LDBCommandExecuteResult(State state, std::string& msg) :
19+
state_(state), message_(msg) {}
2520

2621
std::string ToString() {
2722
std::string ret;

0 commit comments

Comments
 (0)