From 3e3d8041bae61af5bd64cd72923f8b6f8e77f57a Mon Sep 17 00:00:00 2001 From: Guohao Li Date: Thu, 8 Feb 2024 15:27:39 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Dan Wang --- src/runtime/test/host_port_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/test/host_port_test.cpp b/src/runtime/test/host_port_test.cpp index 8e99b0ee6c..f081ae4bc6 100644 --- a/src/runtime/test/host_port_test.cpp +++ b/src/runtime/test/host_port_test.cpp @@ -232,7 +232,7 @@ TEST(host_port_test, dns_resolver) { { host_port hp("localhost", 8080); - auto addr = dns_resolver::instance().resolve_address(hp); + const auto &addr = dns_resolver::instance().resolve_address(hp); ASSERT_TRUE(rpc_address("127.0.0.1", 8080) == addr || rpc_address("127.0.1.1", 8080) == addr); } @@ -247,8 +247,8 @@ TEST(host_port_test, dns_resolver) host_port hp2("localhost", 8081); g_hp->set_leader(hp2); - auto addr_grp = dns_resolver::instance().resolve_address(hp_grp); - auto g_addr = addr_grp.group_address(); + const auto &addr_grp = dns_resolver::instance().resolve_address(hp_grp); + const auto * const g_addr = addr_grp.group_address(); ASSERT_EQ(g_addr->is_update_leader_automatically(), g_hp->is_update_leader_automatically()); ASSERT_STREQ(g_addr->name(), g_hp->name());