From 306ea2df37b7ad8ca216a93a54d995a53c13f83e Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 4 Sep 2024 14:12:30 -0400 Subject: [PATCH] don't apply std::move to prvalue --- libi2pd/HTTP.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libi2pd/HTTP.cpp b/libi2pd/HTTP.cpp index 6e427298..990781bc 100644 --- a/libi2pd/HTTP.cpp +++ b/libi2pd/HTTP.cpp @@ -58,13 +58,13 @@ namespace http static void strsplit(const std::string & line, std::vector &tokens, char delim, std::size_t limit = 0) { - std::stringstream ss(line); + std::stringstream ss{line}; strsplit (ss, tokens, delim, limit); } static void strsplit(std::string_view line, std::vector &tokens, char delim, std::size_t limit = 0) { - std::stringstream ss(std::move(std::string(line))); + std::stringstream ss{std::string(line)}; strsplit (ss, tokens, delim, limit); } @@ -74,16 +74,15 @@ namespace http std::size_t len = 1; /*: */ std::size_t max = line.length(); if ((pos = line.find(':', pos)) == std::string::npos) - return std::make_pair("", ""); // no ':' found + return std::pair{"", ""}; // no ':' found if (pos + 1 < max) // ':' at the end of header is valid { while ((pos + len) < max && isspace(line.at(pos + len))) len++; if (len == 1) - return std::make_pair("", ""); // no following space, but something else + return std::pair{"", ""}; // no following space, but something else } - return std::make_pair(std::move (std::string (line.substr(0, pos))), - std::move (std::string (line.substr(pos + len)))); + return std::pair{std::string (line.substr(0, pos)), std::string (line.substr(pos + len))}; } void gen_rfc7231_date(std::string & out) {