[Improve](doris::Status performance) fix the performance issue due to copy of std::string (#17411)
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -86,7 +86,7 @@ bool BackendOptions::init() {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string BackendOptions::get_localhost() {
|
||||
const std::string& BackendOptions::get_localhost() {
|
||||
return _s_localhost;
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user