Quellcode durchsuchen

Use std::move for request redirection (#2311)

Prevents an additional copy
Aaron Gokaslan vor 1 Monat
Ursprung
Commit
f0990ca96d
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      httplib.h

+ 1 - 1
httplib.h

@@ -10578,7 +10578,7 @@ inline bool ClientImpl::handle_request(Stream &strm, Request &req,
   }
 
   if (300 < res.status && res.status < 400 && follow_location_) {
-    req = req_save;
+    req = std::move(req_save);
     ret = redirect(req, res, error);
   }