run amalgamate

This commit is contained in:
jprochazk 2020-07-19 10:57:17 +02:00
parent ab25de05f7
commit d371a5283c
2 changed files with 12 additions and 8 deletions

View file

@ -2271,7 +2271,8 @@ class binary_reader
string_t& result) string_t& result)
{ {
bool success = true; bool success = true;
for(NumberType i = 0; i < len; i++) { 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")))
{ {
@ -2303,7 +2304,8 @@ class binary_reader
binary_t& result) binary_t& result)
{ {
bool success = true; bool success = true;
for(NumberType i = 0; i < len; i++) { 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")))
{ {

View file

@ -8136,15 +8136,16 @@ 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); result.push_back(std::char_traits<char_type>::to_char_type(current));
}); };
return success; return success;
} }
@ -8168,15 +8169,16 @@ 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;
}
result.push_back(static_cast<std::uint8_t>(current));
} }
return static_cast<std::uint8_t>(current);
});
return success; return success;
} }