diff --git a/src/runtime/test/host_port_test.cpp b/src/runtime/test/host_port_test.cpp index cb290d41b7..ae049cedfa 100644 --- a/src/runtime/test/host_port_test.cpp +++ b/src/runtime/test/host_port_test.cpp @@ -263,7 +263,7 @@ TEST(host_port_test, dns_resolver) void send_and_check_host_port_by_serialize(const host_port &hp, dsn_msg_serialize_format t) { - auto hp_str = hp.to_std_string(); + const auto &hp_str = hp.to_std_string(); ::dsn::rpc_address server("localhost", 20101); dsn::message_ptr msg_ptr = dsn::message_ex::create_request(RPC_TEST_THRIFT_HOST_PORT_PARSER);