Skip to content
Snippets Groups Projects
Commit 7f02ff7b authored by Jason Altekruse's avatar Jason Altekruse
Browse files

refactored ArraySequence.hashCode(), confirmed that the computed hash is...

refactored ArraySequence.hashCode(), confirmed that the computed hash is unchanged. #51
parent 2e6361f1
No related branches found
No related tags found
1 merge request!93XySequence edits
...@@ -6,6 +6,7 @@ import static gov.usgs.earthquake.nshmp.Text.NEWLINE; ...@@ -6,6 +6,7 @@ import static gov.usgs.earthquake.nshmp.Text.NEWLINE;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.Objects;
import java.util.stream.DoubleStream; import java.util.stream.DoubleStream;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -98,11 +99,7 @@ class ArrayXySequence implements XySequence { ...@@ -98,11 +99,7 @@ class ArrayXySequence implements XySequence {
@Override @Override
public final int hashCode() { public final int hashCode() {
final int prime = 31; return Objects.hash(Arrays.hashCode(xs), Arrays.hashCode(ys));
int result = 1;
result = prime * result + Arrays.hashCode(xs);
result = prime * result + Arrays.hashCode(ys);
return result;
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment