Skip to content

Commit

Permalink
Rename another variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Apr 25, 2024
1 parent 290ba88 commit 2fff67d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/sf/json/util/JSONTokener.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ public boolean matches(String pattern) {
}

public boolean startsWith(String prefix) {
int patternLength = prefix.length();
if (length() - this.myIndex < patternLength) {
int prefixLength = prefix.length();
if (length() - this.myIndex < prefixLength) {
return false;
}
String str = this.mySource.substring(this.myIndex, this.myIndex + patternLength);
String str = this.mySource.substring(this.myIndex, this.myIndex + prefixLength);
return str.startsWith(prefix);
}

Expand Down

0 comments on commit 2fff67d

Please sign in to comment.