From: Kefu Chai Date: Wed, 13 Oct 2021 23:38:09 +0000 (+0800) Subject: common/pick_address: use string_view when appropriate X-Git-Tag: v17.1.0~692^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8661ba180759e16daa550b43537d2bbc56a82551;p=ceph-ci.git 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 --- 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) {