From 2362f3d54793ca77669d27fecbc4949a9e714113 Mon Sep 17 00:00:00 2001 From: Christopher Chianelli Date: Thu, 28 Mar 2024 11:40:20 -0400 Subject: [PATCH] chore: Remove unused resolvedJumpTarget from PythonBytecodeInstruction --- .../PythonBytecodeInstruction.java | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/jpyinterpreter/src/main/java/ai/timefold/jpyinterpreter/PythonBytecodeInstruction.java b/jpyinterpreter/src/main/java/ai/timefold/jpyinterpreter/PythonBytecodeInstruction.java index fb520bc..4999f56 100644 --- a/jpyinterpreter/src/main/java/ai/timefold/jpyinterpreter/PythonBytecodeInstruction.java +++ b/jpyinterpreter/src/main/java/ai/timefold/jpyinterpreter/PythonBytecodeInstruction.java @@ -6,10 +6,9 @@ public record PythonBytecodeInstruction(String opname, int offset, int arg, String argRepr, OptionalInt startsLine, - OptionalInt resolvedJumpTarget, boolean isJumpTarget) { + boolean isJumpTarget) { public static PythonBytecodeInstruction atOffset(String opname, int offset) { - return new PythonBytecodeInstruction(opname, offset, 0, "", java.util.OptionalInt.empty(), - java.util.OptionalInt.empty(), false); + return new PythonBytecodeInstruction(opname, offset, 0, "", OptionalInt.empty(), false); } public static PythonBytecodeInstruction atOffset(OpcodeDescriptor instruction, int offset) { @@ -17,29 +16,24 @@ public static PythonBytecodeInstruction atOffset(OpcodeDescriptor instruction, i } public PythonBytecodeInstruction withArg(int newArg) { - return new PythonBytecodeInstruction(opname, offset, newArg, argRepr, startsLine, resolvedJumpTarget, isJumpTarget); + return new PythonBytecodeInstruction(opname, offset, newArg, argRepr, startsLine, isJumpTarget); } public PythonBytecodeInstruction withArgRepr(String newArgRepr) { - return new PythonBytecodeInstruction(opname, offset, arg, newArgRepr, startsLine, resolvedJumpTarget, isJumpTarget); - } - - public PythonBytecodeInstruction withResolvedJumpTarget(int jumpTarget) { - return new PythonBytecodeInstruction(opname, offset, arg, argRepr, startsLine, OptionalInt.of(jumpTarget), - isJumpTarget); + return new PythonBytecodeInstruction(opname, offset, arg, newArgRepr, startsLine, isJumpTarget); } public PythonBytecodeInstruction startsLine(int lineNumber) { - return new PythonBytecodeInstruction(opname, offset, arg, argRepr, OptionalInt.of(lineNumber), resolvedJumpTarget, + return new PythonBytecodeInstruction(opname, offset, arg, argRepr, OptionalInt.of(lineNumber), isJumpTarget); } public PythonBytecodeInstruction withIsJumpTarget(boolean isJumpTarget) { - return new PythonBytecodeInstruction(opname, offset, arg, argRepr, startsLine, resolvedJumpTarget, isJumpTarget); + return new PythonBytecodeInstruction(opname, offset, arg, argRepr, startsLine, isJumpTarget); } public PythonBytecodeInstruction markAsJumpTarget() { - return new PythonBytecodeInstruction(opname, offset, arg, argRepr, startsLine, resolvedJumpTarget, true); + return new PythonBytecodeInstruction(opname, offset, arg, argRepr, startsLine, true); } @Override