Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
triceo committed Jan 19, 2025
1 parent 3e42bf6 commit 446c632
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private Object apply2(A a, B b, C c, D d, Object oldKey) {
if (oldKey == null) {
return new Pair<>(subkey1, subkey2);
}
return ((Pair<Object, Object>) UniKeyFunction.extractSubkey(keyId, keyId))
return ((Pair<Object, Object>) UniKeyFunction.extractSubkey(keyId, oldKey))
.newIfDifferent(subkey1, subkey2);
}

Expand All @@ -69,7 +69,7 @@ private Object apply3(A a, B b, C c, D d, Object oldKey) {
if (oldKey == null) {
return new Triple<>(subkey1, subkey2, subkey3);
}
return ((Triple<Object, Object, Object>) UniKeyFunction.extractSubkey(keyId, keyId))
return ((Triple<Object, Object, Object>) UniKeyFunction.extractSubkey(keyId, oldKey))
.newIfDifferent(subkey1, subkey2, subkey3);
}

Expand All @@ -82,7 +82,7 @@ private Object apply4(A a, B b, C c, D d, Object oldKey) {
if (oldKey == null) {
return new Quadruple<>(subkey1, subkey2, subkey3, subkey4);
}
return ((Quadruple<Object, Object, Object, Object>) UniKeyFunction.extractSubkey(keyId, keyId))
return ((Quadruple<Object, Object, Object, Object>) UniKeyFunction.extractSubkey(keyId, oldKey))
.newIfDifferent(subkey1, subkey2, subkey3, subkey4);
}

Expand All @@ -93,7 +93,7 @@ private Object applyMany(A a, B b, C c, D d, Object oldKey) {
result[i] = mappingFunctions[i].apply(a, b, c, d);
}
} else {
var oldArray = ((IndexerKey) UniKeyFunction.extractSubkey(keyId, keyId)).properties();
var oldArray = ((IndexerKey) UniKeyFunction.extractSubkey(keyId, oldKey)).properties();
var subKeysEqual = true;
for (var i = 0; i < mappingFunctionCount; i++) {
var subkey = mappingFunctions[i].apply(a, b, c, d);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private Object apply2(A a, B b, C c, Object oldKey) {
if (oldKey == null) {
return new Pair<>(subkey1, subkey2);
}
return ((Pair<Object, Object>) UniKeyFunction.extractSubkey(keyId, keyId))
return ((Pair<Object, Object>) UniKeyFunction.extractSubkey(keyId, oldKey))
.newIfDifferent(subkey1, subkey2);
}

Expand All @@ -69,7 +69,7 @@ private Object apply3(A a, B b, C c, Object oldKey) {
if (oldKey == null) {
return new Triple<>(subkey1, subkey2, subkey3);
}
return ((Triple<Object, Object, Object>) UniKeyFunction.extractSubkey(keyId, keyId))
return ((Triple<Object, Object, Object>) UniKeyFunction.extractSubkey(keyId, oldKey))
.newIfDifferent(subkey1, subkey2, subkey3);
}

Expand All @@ -83,8 +83,8 @@ private Object apply4(A a, B b, C c, Object oldKey) {
return new Quadruple<>(subkey1, subkey2, subkey3, subkey4);
}
var oldIndexKeys = (IndexKeys) oldKey;
return ((Quadruple<Object, Object, Object, Object>) oldIndexKeys.get(keyId)).newIfDifferent(subkey1, subkey2, subkey3,
subkey4);
return ((Quadruple<Object, Object, Object, Object>) oldIndexKeys.get(keyId))
.newIfDifferent(subkey1, subkey2, subkey3, subkey4);
}

private Object applyMany(A a, B b, C c, Object oldKey) {
Expand All @@ -94,7 +94,7 @@ private Object applyMany(A a, B b, C c, Object oldKey) {
result[i] = mappingFunctions[i].apply(a, b, c);
}
} else {
var oldArray = ((IndexerKey) UniKeyFunction.extractSubkey(keyId, keyId)).properties();
var oldArray = ((IndexerKey) UniKeyFunction.extractSubkey(keyId, oldKey)).properties();
var subKeysEqual = true;
for (var i = 0; i < mappingFunctionCount; i++) {
var subkey = mappingFunctions[i].apply(a, b, c);
Expand Down

0 comments on commit 446c632

Please sign in to comment.