mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 12:57:31 +02:00
Remove unnecessary constant_time_size for multi_buffer:
http::basic_fields::set_t::size() is unused core::multi_buffer::list_type::size() is only compared to 1 (in shrink_to_fit()); compare iterators instead. close #2498
This commit is contained in:
committed by
Richard Hodges
parent
177855b4bc
commit
78fc61a9f7
@ -1,3 +1,4 @@
|
|||||||
|
* Reduce size of multi_buffer.
|
||||||
* Upgrade OS on some drone CI jobs.
|
* Upgrade OS on some drone CI jobs.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -779,7 +779,7 @@ shrink_to_fit()
|
|||||||
};
|
};
|
||||||
|
|
||||||
// partial last buffer
|
// partial last buffer
|
||||||
if(list_.size() > 1 && out_ != list_.end())
|
if(out_ != list_.begin() && out_ != list_.end())
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(out_ ==
|
BOOST_ASSERT(out_ ==
|
||||||
list_.iterator_to(list_.back()));
|
list_.iterator_to(list_.back()));
|
||||||
@ -815,7 +815,8 @@ shrink_to_fit()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(list_.size() == 1);
|
BOOST_ASSERT(out_ ==
|
||||||
|
list_.iterator_to(list_.back()));
|
||||||
BOOST_ASSERT(out_pos_ > in_pos_);
|
BOOST_ASSERT(out_pos_ > in_pos_);
|
||||||
auto const n = out_pos_ - in_pos_;
|
auto const n = out_pos_ - in_pos_;
|
||||||
auto& e = alloc(n);
|
auto& e = alloc(n);
|
||||||
|
@ -127,7 +127,7 @@ class basic_multi_buffer
|
|||||||
beast::detail::allocator_traits<rebind_type>;
|
beast::detail::allocator_traits<rebind_type>;
|
||||||
|
|
||||||
using list_type = typename boost::intrusive::make_list<
|
using list_type = typename boost::intrusive::make_list<
|
||||||
element, boost::intrusive::constant_time_size<true>>::type;
|
element, boost::intrusive::constant_time_size<false>>::type;
|
||||||
|
|
||||||
using iter = typename list_type::iterator;
|
using iter = typename list_type::iterator;
|
||||||
|
|
||||||
@ -591,4 +591,4 @@ using multi_buffer = basic_multi_buffer<std::allocator<char>>;
|
|||||||
|
|
||||||
#include <boost/beast/core/impl/multi_buffer.hpp>
|
#include <boost/beast/core/impl/multi_buffer.hpp>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -190,7 +190,7 @@ private:
|
|||||||
|
|
||||||
using set_t = typename boost::intrusive::make_multiset<
|
using set_t = typename boost::intrusive::make_multiset<
|
||||||
element,
|
element,
|
||||||
boost::intrusive::constant_time_size<true>,
|
boost::intrusive::constant_time_size<false>,
|
||||||
boost::intrusive::compare<key_compare>
|
boost::intrusive::compare<key_compare>
|
||||||
>::type;
|
>::type;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user