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