forked from boostorg/beast
Avoid string_view::clear:
String views are cleared using assignment from braced initializion, to avoid calling clear().
This commit is contained in:
1 parent
2b32de6cba
commit
ad42096a9d
3 files changed
+11
-10
No files matched your search
@@ -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