mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 13:27:33 +02:00
Avoid string_view::clear:
String views are cleared using assignment from braced initializion, to avoid calling clear().
This commit is contained in:
@@ -4,6 +4,7 @@ Version 153:
|
||||
* Use make_error_code for setting an error_code from errc
|
||||
* Use boost::winapi::GetLastError() consistently
|
||||
* Update README.md for branches
|
||||
* Avoid string_view::clear
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -352,8 +352,8 @@ increment()
|
||||
{
|
||||
it = first;
|
||||
};
|
||||
v.first.clear();
|
||||
v.second.clear();
|
||||
v.first = {};
|
||||
v.second = {};
|
||||
detail::skip_ows(it, last);
|
||||
first = it;
|
||||
if(it == last)
|
||||
|
@@ -364,8 +364,8 @@ basic_fields(basic_fields&& other) noexcept
|
||||
, method_(other.method_)
|
||||
, target_or_reason_(other.target_or_reason_)
|
||||
{
|
||||
other.method_.clear();
|
||||
other.target_or_reason_.clear();
|
||||
other.method_ = {};
|
||||
other.target_or_reason_ = {};
|
||||
}
|
||||
|
||||
template<class Allocator>
|
||||
@@ -1221,7 +1221,7 @@ realloc_string(string_view& dest, string_view s)
|
||||
{
|
||||
a.deallocate(const_cast<char*>(
|
||||
dest.data()), dest.size());
|
||||
dest.clear();
|
||||
dest = {};
|
||||
}
|
||||
if(! s.empty())
|
||||
{
|
||||
@@ -1249,7 +1249,7 @@ realloc_target(
|
||||
{
|
||||
a.deallocate(const_cast<char*>(
|
||||
dest.data()), dest.size());
|
||||
dest.clear();
|
||||
dest = {};
|
||||
}
|
||||
if(! s.empty())
|
||||
{
|
||||
@@ -1305,8 +1305,8 @@ move_assign(basic_fields& other, std::true_type)
|
||||
list_ = std::move(other.list_);
|
||||
method_ = other.method_;
|
||||
target_or_reason_ = other.target_or_reason_;
|
||||
other.method_.clear();
|
||||
other.target_or_reason_.clear();
|
||||
other.method_ = {};
|
||||
other.target_or_reason_ = {};
|
||||
this->member() = other.member();
|
||||
}
|
||||
|
||||
@@ -1328,8 +1328,8 @@ move_assign(basic_fields& other, std::false_type)
|
||||
list_ = std::move(other.list_);
|
||||
method_ = other.method_;
|
||||
target_or_reason_ = other.target_or_reason_;
|
||||
other.method_.clear();
|
||||
other.target_or_reason_.clear();
|
||||
other.method_ = {};
|
||||
other.target_or_reason_ = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user