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()) {
case ';':
case ',':
c = x.nextClean();
if (c == 0) {
throw x.syntaxError("A JSONObject text must end with '}'");
}
if (c == '}') {
if (x.nextClean() == '}') {
return;
}
if (x.end()) {
throw x.syntaxError("A JSONObject text must end with '}'");
}
x.back();
break;
case '}':