read_size replaces read_size_helper:

* detail::read_size_helper is removed

* public function read_size helps determine the optimum
  size for calls to a DynamicBuffer's prepare function.

* special case for Asio types which don't conform to
  the concept but have their own helper function.
This commit is contained in:
Vinnie Falco
2017-07-20 08:12:20 -07:00
parent fe4dfed27b
commit a49c096042
18 changed files with 212 additions and 147 deletions
+2 -3
View File
@@ -7,8 +7,8 @@
#include <beast/core/flat_buffer.hpp>
#include <beast/core/multi_buffer.hpp>
#include <beast/core/read_size.hpp>
#include <beast/core/string_view.hpp>
#include <beast/core/detail/read_size_helper.hpp>
#include <beast/unit_test/suite.hpp>
#include <boost/asio/streambuf.hpp>
#include <algorithm>
@@ -111,9 +111,8 @@ public:
{
for(auto remain = size; remain;)
{
using beast::detail::read_size_helper;
auto const n = fill(b.prepare(
read_size_helper(b, remain)));
read_size(b, remain)));
b.commit(n);
remain -= n;
total += n;