Skip to content

Commit

Permalink
Improve skip_space
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 15, 2024
1 parent 7a0f2db commit ef57656
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions include/jsoncons/json_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <jsoncons/json_parser.hpp>
#include <jsoncons/source_adaptor.hpp>

namespace jsoncons {
namespace jsoncons {

// utf8_other_json_input_adapter

Expand Down Expand Up @@ -319,9 +319,22 @@ namespace jsoncons {
return;
}

if (!source_.eof())
while (!source_.eof())
{
parser_.skip_whitespace(ec);
parser_.skip_space(ec);
if (parser_.source_exhausted())
{
auto s1 = source_.read_buffer(ec);
if (ec) return;
if (s1.size() > 0)
{
parser_.set_buffer(s1.data(),s1.size());
}
}
else
{
break;
}
}
}

Expand Down

0 comments on commit ef57656

Please sign in to comment.