Commit a3a9d566 authored by jprochazk's avatar jprochazk

add break to binary_reader::get_binary and get_string

parent 43ab8a23
...@@ -2271,15 +2271,15 @@ class binary_reader ...@@ -2271,15 +2271,15 @@ class binary_reader
string_t& result) string_t& result)
{ {
bool success = true; bool success = true;
std::generate_n(std::back_inserter(result), len, [this, &success, &format]() for(NumberType i = 0; i < len; i++) {
{
get(); get();
if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "string"))) if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "string")))
{ {
success = false; success = false;
break;
} }
return std::char_traits<char_type>::to_char_type(current); return std::char_traits<char_type>::to_char_type(current);
}); };
return success; return success;
} }
...@@ -2303,15 +2303,15 @@ class binary_reader ...@@ -2303,15 +2303,15 @@ class binary_reader
binary_t& result) binary_t& result)
{ {
bool success = true; bool success = true;
std::generate_n(std::back_inserter(result), len, [this, &success, &format]() for(NumberType i = 0; i < len; i++) {
{
get(); get();
if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary")))
{ {
success = false; success = false;
break;
} }
return static_cast<std::uint8_t>(current); return static_cast<std::uint8_t>(current);
}); }
return success; return success;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment