]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/pick_address: use string_view when appropriate
authorKefu Chai <tchaikov@gmail.com>
Wed, 13 Oct 2021 23:38:09 +0000 (07:38 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 14 Oct 2021 01:23:00 +0000 (01:23 +0000)
we don't need a string when string_view is good enough.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/common/pick_address.cc

index 203e1d63f170b14e029c9a1d50f0e194c2cdbcd4..1b7831c06063404c181151530ae6819e330aa21a 100644 (file)
@@ -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) {