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 5402c4d commit 48e7b05
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.startsWith("$["))
&& path.substring(2).equals(pathToMatch));
|| (path.startsWith("$.") && path.substring(2).equals(pathToMatch))
|| (path.startsWith("$[") && path.substring(1).equals(pathToMatch));
}
}

Expand Down

0 comments on commit 48e7b05

Please sign in to comment.