Skip to content

Commit

Permalink
Apply simplification suggested by @johnjaylward.
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnmcmanus committed Aug 1, 2023
1 parent b6ff0db commit 2a4bc34
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/org/json/JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,12 @@ public JSONObject(JSONTokener x) throws JSONException {
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 '}':
Expand Down

0 comments on commit 2a4bc34

Please sign in to comment.