Apply simplification suggested by @johnjaylward.

This commit is contained in:
Éamonn McManus 2023-08-01 14:38:45 -07:00
parent b6ff0db984
commit 2a4bc3420a

View File

@ -253,13 +253,12 @@ public class JSONObject {
switch (x.nextClean()) { switch (x.nextClean()) {
case ';': case ';':
case ',': case ',':
c = x.nextClean(); if (x.nextClean() == '}') {
if (c == 0) {
throw x.syntaxError("A JSONObject text must end with '}'");
}
if (c == '}') {
return; return;
} }
if (x.end()) {
throw x.syntaxError("A JSONObject text must end with '}'");
}
x.back(); x.back();
break; break;
case '}': case '}':