Skip to content

Commit

Permalink
Use assertion for impossible case(The Predict() can ensure the token …
Browse files Browse the repository at this point in the history
…is ColonToken, otherwise it would be marked as Error state. So there is no need to check ColonToken again).
  • Loading branch information
thebusytypist committed Apr 15, 2015
1 parent 8576747 commit 3993332
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions include/rapidjson/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -1273,12 +1273,9 @@ class GenericReader {
return dst;

case IterativeParsingKeyValueDelimiterState:
if (token == ColonToken) {
is.Take();
return dst;
}
else
return IterativeParsingErrorState;
RAPIDJSON_ASSERT(token == ColonToken);
is.Take();
return dst;

case IterativeParsingMemberValueState:
// Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
Expand Down

0 comments on commit 3993332

Please sign in to comment.