Sfoglia il codice sorgente

Remove another unnecessary string copy (#2305)

Aaron Gokaslan 1 mese fa
parent
commit
ae94d64f67
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      httplib.h

+ 1 - 1
httplib.h

@@ -6880,7 +6880,7 @@ inline void hosted_at(const std::string &hostname,
     auto dummy = -1;
     if (detail::get_ip_and_port(addr, sizeof(struct sockaddr_storage), ip,
                                 dummy)) {
-      addrs.push_back(ip);
+      addrs.emplace_back(std::move(ip));
     }
   }
 }