Skip to content

Commit

Permalink
Remove inaccurate local variable update code
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Jun 3, 2024
1 parent 2eaf54e commit 097ebfe
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,8 @@ private static Optional<LocalVar> tryFindUpdatedIndex(Type targetType, MethodCon
if (dirtyNameOrdinal.isEmpty() || local.relative() && ordinal == dirtyNameOrdinal.getAsInt()) {
return Optional.empty();
}
List<LocalVariableNode> actual = dirtyLocals.stream()
.filter(lvn -> GeneratedVariables.getGeneratedVariableOrdinal(lvn.name, Type.getType(lvn.desc)).orElse(-1) == ordinal)
.toList();
if (actual.size() == 1) {
LocalVariableNode lvn = actual.get(0);
return Optional.of(new LocalVar(lvn, dirtyLocals.indexOf(lvn)));
}

if (cleanLocal.index != dirtyLocal.index) {
if (cleanLocal.index != dirtyLocal.index && !local.relative()) {
return Optional.of(new LocalVar(dirtyLocal, dirtyLocals.indexOf(dirtyLocal)));
}

Expand Down

0 comments on commit 097ebfe

Please sign in to comment.