From bce08e62f96b31cad6f13597c9cdd5219f1a51aa Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Sat, 13 Dec 2025 22:49:58 -0500 Subject: [PATCH] Remove unnecessary copies for AcceptEntry (#2303) --- httplib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httplib.h b/httplib.h index 43cf2b9..2ad77fc 100644 --- a/httplib.h +++ b/httplib.h @@ -5941,7 +5941,7 @@ inline bool parse_accept_header(const std::string &s, return; } - entries.push_back(accept_entry); + entries.push_back(std::move(accept_entry)); }); // Return false if any invalid entry was found @@ -5958,8 +5958,8 @@ inline bool parse_accept_header(const std::string &s, // Extract sorted media types content_types.reserve(entries.size()); - for (const auto &entry : entries) { - content_types.push_back(entry.media_type); + for (auto &entry : entries) { + content_types.push_back(std::move(entry.media_type)); } return true;