[Improve](doris::Status performance) fix the performance issue due to copy of std::string (#17411)

This commit is contained in:
lihangyu
2023-03-04 15:08:59 +08:00
committed by GitHub
parent 82df2ae9d8
commit 2b014a0464
3 changed files with 3 additions and 3 deletions

View File

@ -479,7 +479,7 @@ private:
#endif
};
std::unique_ptr<ErrMsg> _err_msg;
std::string _be_ip = BackendOptions::get_localhost();
std::string_view _be_ip = BackendOptions::get_localhost();
};
inline std::ostream& operator<<(std::ostream& ostr, const Status& status) {

View File

@ -86,7 +86,7 @@ bool BackendOptions::init() {
return true;
}
std::string BackendOptions::get_localhost() {
const std::string& BackendOptions::get_localhost() {
return _s_localhost;
}

View File

@ -29,7 +29,7 @@ class CIDR;
class BackendOptions {
public:
static bool init();
static std::string get_localhost();
static const std::string& get_localhost();
static bool is_bind_ipv6();
static const char* get_service_bind_address();