Skip to content

Commit

Permalink
Optimize path comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Feb 21, 2024
1 parent 69285ff commit 5402c4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ private static class SimplePathMatcher extends PathMatcher {
@Override
boolean matches(String pathToMatch) {
return path.equals(pathToMatch)
|| (path.startsWith("$.") && path.substring(2).equals(pathToMatch))
|| (path.startsWith("$") && path.substring(1).equals(pathToMatch));
|| ((path.startsWith("$.") || path.startsWith("$["))
&& path.substring(2).equals(pathToMatch));
}
}

Expand Down

0 comments on commit 5402c4d

Please sign in to comment.