1
0
mirror of synced 2025-12-17 04:02:14 +03:00

Remove unnecessary copies for AcceptEntry (#2303)

This commit is contained in:
Aaron Gokaslan
2025-12-13 22:49:58 -05:00
committed by GitHub
parent f4ecb96e54
commit bce08e62f9

View File

@@ -5941,7 +5941,7 @@ inline bool parse_accept_header(const std::string &s,
return; return;
} }
entries.push_back(accept_entry); entries.push_back(std::move(accept_entry));
}); });
// Return false if any invalid entry was found // 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 // Extract sorted media types
content_types.reserve(entries.size()); content_types.reserve(entries.size());
for (const auto &entry : entries) { for (auto &entry : entries) {
content_types.push_back(entry.media_type); content_types.push_back(std::move(entry.media_type));
} }
return true; return true;