Skip to content

Commit

Permalink
#845 Replace CuckooObjectMap in DefaultClassResolver with `Object…
Browse files Browse the repository at this point in the history
…Map`
  • Loading branch information
theigl committed Jan 18, 2022
1 parent d2764c6 commit 6365edc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/com/esotericsoftware/kryo/util/CuckooObjectMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* depending on hash collisions. Load factors greater than 0.91 greatly increase the chances the map will have to rehash to the
* next higher POT size.
* @author Nathan Sweet */
@Deprecated
public class CuckooObjectMap<K, V> {
// primes for hash functions 2, 3, and 4
private static final int PRIME2 = 0xbe1f14b1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class DefaultClassResolver implements ClassResolver {
protected Kryo kryo;

protected final IntMap<Registration> idToRegistration = new IntMap<>();
protected final CuckooObjectMap<Class, Registration> classToRegistration = new CuckooObjectMap<>();
protected final ObjectMap<Class, Registration> classToRegistration = new ObjectMap<>();

protected IdentityObjectIntMap<Class> classToNameId;
protected IntMap<Class> nameIdToClass;
Expand Down
2 changes: 1 addition & 1 deletion src/com/esotericsoftware/kryo/util/IdentityMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ int locateKey (K key) {
K[] keyTable = this.keyTable;
for (int i = place(key);; i = i + 1 & mask) {
K other = keyTable[i];
if (other == key) return i; // Same key was found.
if (other == null) return -(i + 1); // Empty space is available.
if (other == key) return i; // Same key was found.
}
}

Expand Down

0 comments on commit 6365edc

Please sign in to comment.