Use standard (not Identity) HashMaps for OptionKeys and NodeMetadataKeys

This commit is contained in:
Luck committed 2019-12-13 14:02:31 +00:00
1 parent 37367fe91f
commit bd349ac4a3
3 files changed
+8 -5

No files matched your search

@@ -32,10 +32,12 @@ import java.util.Objects;
final class SimpleOptionKey<T> implements OptionKey<T> {
private final String name;
private final Class<T> type;
private final int hashCode;
SimpleOptionKey(String name, Class<T> type) {
this.name = name.toLowerCase();
this.type = type;
this.hashCode = Objects.hash(this.name, this.type); // cache hashcode
}
@Override
@@ -64,6 +66,6 @@ final class SimpleOptionKey<T> implements OptionKey<T> {
@Override
public int hashCode() {
return Objects.hash(this.name, this.type);
return this.hashCode;
}
}