Skip to content

Commit

Permalink
#845 Experiment with default loadFactor of 0.75
Browse files Browse the repository at this point in the history
  • Loading branch information
theigl committed Jan 23, 2022
1 parent 42b08d2 commit 66bf106
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/com/esotericsoftware/kryo/util/IdentityObjectIntMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
* @author Nathan Sweet
* @author Tommy Ettinger */
public class IdentityObjectIntMap<K> extends ObjectIntMap<K> {
/** Creates a new map with an initial capacity of 51 and a load factor of 0.8. */
/** Creates a new map with an initial capacity of 51 and a load factor of 0.75. */
public IdentityObjectIntMap () {
super();
}

/** Creates a new map with a load factor of 0.8.
/** Creates a new map with a load factor of 0.75.
* @param initialCapacity If not a power of two, it is increased to the next nearest power of two. */
public IdentityObjectIntMap (int initialCapacity) {
super(initialCapacity);
Expand Down
8 changes: 4 additions & 4 deletions src/com/esotericsoftware/kryo/util/IntMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ public class IntMap<V> implements Iterable<IntMap.Entry<V>> {
* hash. */
protected int mask;

/** Creates a new map with an initial capacity of 51 and a load factor of 0.8. */
/** Creates a new map with an initial capacity of 51 and a load factor of 0.75. */
public IntMap () {
this(51, 0.8f);
this(51, 0.75f);
}

/** Creates a new map with a load factor of 0.8.
/** Creates a new map with a load factor of 0.75.
*
* @param initialCapacity If not a power of two, it is increased to the next nearest power of two. */
public IntMap (int initialCapacity) {
this(initialCapacity, 0.8f);
this(initialCapacity, 0.75f);
}

/** Creates a new map with the specified initial capacity and load factor. This map will hold initialCapacity items before
Expand Down
8 changes: 4 additions & 4 deletions src/com/esotericsoftware/kryo/util/ObjectIntMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public class ObjectIntMap<K> implements Iterable<ObjectIntMap.Entry<K>> {
* hash. */
protected int mask;

/** Creates a new map with an initial capacity of 51 and a load factor of 0.8. */
/** Creates a new map with an initial capacity of 51 and a load factor of 0.75. */
public ObjectIntMap () {
this(51, 0.8f);
this(51, 0.75f);
}

/** Creates a new map with a load factor of 0.8.
/** Creates a new map with a load factor of 0.75.
* @param initialCapacity If not a power of two, it is increased to the next nearest power of two. */
public ObjectIntMap (int initialCapacity) {
this(initialCapacity, 0.8f);
this(initialCapacity, 0.75f);
}

/** Creates a new map with the specified initial capacity and load factor. This map will hold initialCapacity items before
Expand Down
8 changes: 4 additions & 4 deletions src/com/esotericsoftware/kryo/util/ObjectMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public class ObjectMap<K, V> implements Iterable<ObjectMap.Entry<K, V>> {
* hash. */
protected int mask;

/** Creates a new map with an initial capacity of 51 and a load factor of 0.8. */
/** Creates a new map with an initial capacity of 51 and a load factor of 0.75. */
public ObjectMap () {
this(51, 0.8f);
this(51, 0.75f);
}

/** Creates a new map with a load factor of 0.8.
/** Creates a new map with a load factor of 0.75.
* @param initialCapacity If not a power of two, it is increased to the next nearest power of two. */
public ObjectMap (int initialCapacity) {
this(initialCapacity, 0.8f);
this(initialCapacity, 0.75f);
}

/** Creates a new map with the specified initial capacity and load factor. This map will hold initialCapacity items before
Expand Down

0 comments on commit 66bf106

Please sign in to comment.