Skip to content

Commit

Permalink
mutator: Fix method name in MapMutatorFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Apr 6, 2023
1 parent 7fc394d commit 3969c02
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected Map<K, V> makeDefaultInstance() {
@Override
public void initInPlace(Map<K, V> reference, PseudoRandom prng) {
int targetSize = prng.closedRange(minInitialSize(), maxInitialSize());
Map<K, V> map = underlyingMutableList(reference);
Map<K, V> map = underlyingMutableMap(reference);
map.clear();
for (int i = 0; i < targetSize; i++) {
initElement(map, prng);
Expand All @@ -129,7 +129,7 @@ public void initInPlace(Map<K, V> reference, PseudoRandom prng) {

@Override
public void mutateInPlace(Map<K, V> reference, PseudoRandom prng) {
Map<K, V> map = underlyingMutableList(reference);
Map<K, V> map = underlyingMutableMap(reference);
if (map.isEmpty()) {
initElement(map, prng);
} else if (!prng.trueInOneOutOf(4)) {
Expand Down Expand Up @@ -216,7 +216,7 @@ private int maxInitialSize() {
return min(maxSize, minSize + 1);
}

private Map<K, V> underlyingMutableList(Map<K, V> value) {
private Map<K, V> underlyingMutableMap(Map<K, V> value) {
if (value instanceof ImmutableMapView<?, ?>) {
// An immutable map view created by us, so we know how to get back at the mutable list.
return ((ImmutableMapView<K, V>) value).asMutableMap();
Expand Down

0 comments on commit 3969c02

Please sign in to comment.