File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -76,29 +76,29 @@ parse(
7676 p.reset (std::move (sp));
7777
7878 char read_buffer[BOOST_JSON_STACK_BUFFER_SIZE / 2 ];
79- while ( true )
79+ do
8080 {
81- if ( is.rdstate () & std::ios::eofbit )
81+ if ( is.eof () )
8282 {
8383 p.finish (ec);
84- if ( ec.failed () )
85- return nullptr ;
8684 break ;
8785 }
8886
89- if ( is. rdstate () != std::ios::goodbit )
87+ if ( !is )
9088 {
9189 BOOST_JSON_FAIL ( ec, error::input_error );
92- return nullptr ;
90+ break ;
9391 }
9492
9593 is.read (read_buffer, sizeof (read_buffer));
9694 auto const consumed = is.gcount ();
9795
9896 p.write (read_buffer, consumed, ec);
99- if ( ec.failed () )
100- return nullptr ;
10197 }
98+ while ( !ec.failed () );
99+
100+ if ( ec.failed () )
101+ return nullptr ;
102102
103103 return p.release ();
104104}
You can’t perform that action at this time.
0 commit comments