Skip to content

Commit 74f6147

Browse files
committed
Move RegexpCacheKey#equals checks around so the most expensive is performed last.
1 parent 0abaa1c commit 74f6147

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/core/regexp/RegexpCacheKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public int hashCode() {
5151
public boolean equals(Object o) {
5252
if (o instanceof RegexpCacheKey) {
5353
final RegexpCacheKey other = (RegexpCacheKey) o;
54-
return rope.equals(other.rope) && encoding == other.encoding && joniOptions == other.joniOptions;
54+
return encoding == other.encoding && joniOptions == other.joniOptions && rope.equals(other.getRope());
5555
} else {
5656
return false;
5757
}

0 commit comments

Comments
 (0)