1
0
mirror of synced 2025-04-20 11:47:43 +03:00

reserving before encoding (#912)

This commit is contained in:
Aswin Raj Kharel 2021-04-24 15:19:14 -05:00 committed by GitHub
parent 7c60e69c33
commit c58b00580e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1612,6 +1612,7 @@ inline std::string encode_query_param(const std::string &value) {
inline std::string encode_url(const std::string &s) { inline std::string encode_url(const std::string &s) {
std::string result; std::string result;
result.reserve(s.size());
for (size_t i = 0; s[i]; i++) { for (size_t i = 0; s[i]; i++) {
switch (s[i]) { switch (s[i]) {