diff --git a/CHANGELOG.md b/CHANGELOG.md index 36f84c83..288d241b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 81: + +* Pass string_view by value + +-------------------------------------------------------------------------------- + Version 80: * Javadoc tidying diff --git a/include/beast/core/impl/string_param.ipp b/include/beast/core/impl/string_param.ipp index 8bcccca4..46332ec4 100644 --- a/include/beast/core/impl/string_param.ipp +++ b/include/beast/core/impl/string_param.ipp @@ -41,7 +41,7 @@ print(T const& t) inline void string_param:: -print(string_view const& sv) +print(string_view sv) { sv_ = sv; } diff --git a/include/beast/core/string.hpp b/include/beast/core/string.hpp index 60116098..bf788bc5 100644 --- a/include/beast/core/string.hpp +++ b/include/beast/core/string.hpp @@ -60,8 +60,8 @@ ascii_tolower(char c) template bool iequals( - beast::string_view const& lhs, - beast::string_view const& rhs) + beast::string_view lhs, + beast::string_view rhs) { auto n = lhs.size(); if(rhs.size() != n) @@ -102,8 +102,8 @@ iequals( inline bool iequals( - beast::string_view const& lhs, - beast::string_view const& rhs) + beast::string_view lhs, + beast::string_view rhs) { return detail::iequals(lhs, rhs); } @@ -116,8 +116,8 @@ struct iless { bool operator()( - string_view const& lhs, - string_view const& rhs) const + string_view lhs, + string_view rhs) const { using std::begin; using std::end; @@ -139,8 +139,8 @@ struct iequal { bool operator()( - string_view const& lhs, - string_view const& rhs) const + string_view lhs, + string_view rhs) const { return iequals(lhs, rhs); } diff --git a/include/beast/core/string_param.hpp b/include/beast/core/string_param.hpp index dedd060a..9c90ee64 100644 --- a/include/beast/core/string_param.hpp +++ b/include/beast/core/string_param.hpp @@ -45,7 +45,7 @@ class string_param print(T const&); void - print(string_view const&); + print(string_view); template typename std::enable_if< diff --git a/include/beast/http/impl/field.ipp b/include/beast/http/impl/field.ipp index 6d4f2c50..ba4a5ac0 100644 --- a/include/beast/http/impl/field.ipp +++ b/include/beast/http/impl/field.ipp @@ -28,7 +28,7 @@ struct field_table struct hash { std::size_t - operator()(string_view const& s) const + operator()(string_view s) const { auto const n = s.size(); return @@ -43,8 +43,8 @@ struct field_table // assumes inputs have equal length bool operator()( - string_view const& lhs, - string_view const& rhs) const + string_view lhs, + string_view rhs) const { auto p1 = lhs.data(); auto p2 = rhs.data(); diff --git a/include/beast/http/impl/fields.ipp b/include/beast/http/impl/fields.ipp index a6697c6c..1cee2ba0 100644 --- a/include/beast/http/impl/fields.ipp +++ b/include/beast/http/impl/fields.ipp @@ -737,7 +737,7 @@ template void filter_token_list( String& s, - string_view const& value, + string_view value, Pred&& pred) { token_list te{value}; @@ -764,7 +764,7 @@ template void filter_token_list_last( String& s, - string_view const& value, + string_view value, Pred&& pred) { token_list te{value}; @@ -801,7 +801,7 @@ filter_token_list_last( template void keep_alive_impl( - String& s, string_view const& value, + String& s, string_view value, unsigned version, bool keep_alive) { if(version < 11) @@ -1025,7 +1025,7 @@ set_chunked_impl(bool value) { static_string buf; detail::filter_token_list_last(buf, it->value(), - [](string_view const& s) + [](string_view s) { return iequals(s, "chunked"); }); @@ -1050,7 +1050,7 @@ set_chunked_impl(bool value) #endif s.reserve(it->value().size()); detail::filter_token_list_last(s, it->value(), - [](string_view const& s) + [](string_view s) { return iequals(s, "chunked"); });