Commit 08602884 authored by Kamal Marhubi's avatar Kamal Marhubi

Use inputExhausted more

parent 6b54e8fe
...@@ -390,7 +390,7 @@ public: ...@@ -390,7 +390,7 @@ public:
consumeWhitespace(); consumeWhitespace();
KJ_DEFER(consumeWhitespace()); KJ_DEFER(consumeWhitespace());
KJ_REQUIRE(remaining_.size() > 0, "JSON message ends prematurely."); KJ_REQUIRE(!inputExhausted(), "JSON message ends prematurely.");
switch (nextChar()) { switch (nextChar()) {
case 'n': consume(NULL_); output.setNull(); break; case 'n': consume(NULL_); output.setNull(); break;
...@@ -503,7 +503,7 @@ public: ...@@ -503,7 +503,7 @@ public:
} }
char nextChar() { char nextChar() {
KJ_REQUIRE(remaining_.size() > 0, "JSON message ends prematurely."); KJ_REQUIRE(!inputExhausted(), "JSON message ends prematurely.");
return remaining_.front(); return remaining_.front();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment