Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Borondo committed Oct 3, 2018
1 parent 9f18e17 commit 0231059
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions include/nlohmann/detail/input/input_adapters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,7 @@ class wide_string_input_adapter : public input_adapter_protocol
// check if buffer needs to be filled
if (utf8_bytes_index == utf8_bytes_filled)
{
if (sizeof(typename WideStringType::value_type) == 2)
{
fill_buffer_utf16();
}
else
{
fill_buffer_utf32();
}
fill_buffer(sizeof(typename WideStringType::value_type));

assert(utf8_bytes_filled > 0);
assert(utf8_bytes_index == 0);
Expand All @@ -146,6 +139,18 @@ class wide_string_input_adapter : public input_adapter_protocol
}

private:
void fill_buffer(size_t size)
{
if (2 == size)
{
fill_buffer_utf16();
}
else
{
fill_buffer_utf32();
}
}

void fill_buffer_utf16()
{
utf8_bytes_index = 0;
Expand Down

0 comments on commit 0231059

Please sign in to comment.