Skip to content

Commit 63ff805

Browse files
committed
GH-5447 improve performance of DefaultBindingSetKey
1 parent f8d1887 commit 63ff805

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

core/collection-factory/api/src/main/java/org/eclipse/rdf4j/collection/factory/impl/DefaultBindingSetKey.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
package org.eclipse.rdf4j.collection.factory.impl;
1313

1414
import java.io.Serializable;
15-
import java.util.Arrays;
1615
import java.util.List;
1716

1817
import org.eclipse.rdf4j.collection.factory.api.BindingSetKey;
@@ -22,12 +21,12 @@ public class DefaultBindingSetKey implements BindingSetKey, Serializable {
2221

2322
private static final long serialVersionUID = 1;
2423

25-
private final Value[] values;
24+
private final List<Value> values;
2625

2726
private final int hash;
2827

2928
public DefaultBindingSetKey(List<Value> values, int hash) {
30-
this.values = values.toArray(new Value[0]);
29+
this.values = values;
3130
this.hash = hash;
3231
}
3332

@@ -39,7 +38,7 @@ public int hashCode() {
3938
@Override
4039
public boolean equals(Object other) {
4140
if (other instanceof DefaultBindingSetKey && other.hashCode() == hash) {
42-
return Arrays.deepEquals(values, ((DefaultBindingSetKey) other).values);
41+
return values.equals(((DefaultBindingSetKey) other).values);
4342
}
4443
return false;
4544
}

0 commit comments

Comments
 (0)