mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
Tidy up static_buffer braced init
This commit is contained in:
@@ -5,6 +5,7 @@ Version 95:
|
||||
* Fix race in test::pipe
|
||||
* close on test::pipe teardown
|
||||
* Add test::stream
|
||||
* Tidy up static_buffer braced init
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -37,12 +37,12 @@ data() const ->
|
||||
{
|
||||
using boost::asio::const_buffer;
|
||||
if(in_off_ + in_size_ <= capacity_)
|
||||
return {
|
||||
const_buffer{ begin_ + in_off_, in_size_ },
|
||||
const_buffer{ begin_, 0 } };
|
||||
return {
|
||||
const_buffer{ begin_ + in_off_, capacity_ - in_off_ },
|
||||
const_buffer{ begin_, in_size_ - (capacity_ - in_off_) } };
|
||||
return {{
|
||||
const_buffer{begin_ + in_off_, in_size_},
|
||||
const_buffer{begin_, 0}}};
|
||||
return {{
|
||||
const_buffer{begin_ + in_off_, capacity_ - in_off_},
|
||||
const_buffer{begin_, in_size_ - (capacity_ - in_off_)}}};
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -53,12 +53,12 @@ mutable_data() ->
|
||||
{
|
||||
using boost::asio::mutable_buffer;
|
||||
if(in_off_ + in_size_ <= capacity_)
|
||||
return {
|
||||
mutable_buffer{ begin_ + in_off_, in_size_ },
|
||||
mutable_buffer{ begin_, 0 } };
|
||||
return {
|
||||
mutable_buffer{ begin_ + in_off_, capacity_ - in_off_ },
|
||||
mutable_buffer{ begin_, in_size_ - (capacity_ - in_off_) } };
|
||||
return {{
|
||||
mutable_buffer{begin_ + in_off_, in_size_},
|
||||
mutable_buffer{begin_, 0}}};
|
||||
return {{
|
||||
mutable_buffer{begin_ + in_off_, capacity_ - in_off_},
|
||||
mutable_buffer{begin_, in_size_ - (capacity_ - in_off_)}}};
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -74,12 +74,12 @@ prepare(std::size_t size) ->
|
||||
out_size_ = size;
|
||||
auto const out_off = (in_off_ + in_size_) % capacity_;
|
||||
if(out_off + out_size_ <= capacity_ )
|
||||
return {
|
||||
mutable_buffer{ begin_ + out_off, out_size_ },
|
||||
mutable_buffer{ begin_, 0 } };
|
||||
return {
|
||||
mutable_buffer{ begin_ + out_off, capacity_ - out_off },
|
||||
mutable_buffer{ begin_, out_size_ - (capacity_ - out_off) } };
|
||||
return {{
|
||||
mutable_buffer{begin_ + out_off, out_size_},
|
||||
mutable_buffer{begin_, 0}}};
|
||||
return {{
|
||||
mutable_buffer{begin_ + out_off, capacity_ - out_off},
|
||||
mutable_buffer{begin_, out_size_ - (capacity_ - out_off)}}};
|
||||
}
|
||||
|
||||
inline
|
||||
|
Reference in New Issue
Block a user