Skip to content

Commit

Permalink
Simplify captures equals method
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjian2664 authored and wendigo committed Oct 13, 2023
1 parent e54e4dc commit c350679
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/trino-matching/src/main/java/io/trino/matching/Captures.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package io.trino.matching;

import java.util.NoSuchElementException;
import java.util.Objects;

public class Captures
{
Expand Down Expand Up @@ -71,14 +72,9 @@ public boolean equals(Object o)
}

Captures captures = (Captures) o;

if (capture != null ? !capture.equals(captures.capture) : captures.capture != null) {
return false;
}
if (value != null ? !value.equals(captures.value) : captures.value != null) {
return false;
}
return tail != null ? tail.equals(captures.tail) : captures.tail == null;
return Objects.equals(capture, captures.capture)
&& Objects.equals(value, captures.value)
&& Objects.equals(tail, captures.tail);
}

@Override
Expand Down

0 comments on commit c350679

Please sign in to comment.