From 8661ba180759e16daa550b43537d2bbc56a82551 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 14 Oct 2021 07:38:09 +0800 Subject: [PATCH] common/pick_address: use string_view when appropriate we don't need a string when string_view is good enough. Signed-off-by: Kefu Chai --- src/common/pick_address.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/pick_address.cc b/src/common/pick_address.cc index 203e1d63f17..1b7831c0606 100644 --- a/src/common/pick_address.cc +++ b/src/common/pick_address.cc @@ -308,7 +308,7 @@ static int fill_in_one_address( interfaces, numa_node); if (!found) { - std::string ip_type = ""; + std::string_view ip_type; if ((ipv & CEPH_PICK_ADDRESS_IPV4) && (ipv & CEPH_PICK_ADDRESS_IPV6)) { ip_type = "IPv4 or IPv6"; } else if (ipv & CEPH_PICK_ADDRESS_IPV4) { -- 2.39.5