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(
76
76
p.reset (std::move (sp));
77
77
78
78
char read_buffer[BOOST_JSON_STACK_BUFFER_SIZE / 2 ];
79
- while ( true )
79
+ do
80
80
{
81
- if ( is.rdstate () & std::ios::eofbit )
81
+ if ( is.eof () )
82
82
{
83
83
p.finish (ec);
84
- if ( ec.failed () )
85
- return nullptr ;
86
84
break ;
87
85
}
88
86
89
- if ( is. rdstate () != std::ios::goodbit )
87
+ if ( !is )
90
88
{
91
89
BOOST_JSON_FAIL ( ec, error::input_error );
92
- return nullptr ;
90
+ break ;
93
91
}
94
92
95
93
is.read (read_buffer, sizeof (read_buffer));
96
94
auto const consumed = is.gcount ();
97
95
98
96
p.write (read_buffer, consumed, ec);
99
- if ( ec.failed () )
100
- return nullptr ;
101
97
}
98
+ while ( !ec.failed () );
99
+
100
+ if ( ec.failed () )
101
+ return nullptr ;
102
102
103
103
return p.release ();
104
104
}
You can’t perform that action at this time.
0 commit comments