mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-25 22:46:11 +00:00
Fixed #1842 AS - Do not display §§dup when the value has no sideeffect
This commit is contained in:
@@ -49,7 +49,7 @@ public class DuplicateItem extends GraphTargetItem implements SimpleValue {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
if (((value instanceof SimpleValue) && (((SimpleValue) value).isSimpleValue())) || !Configuration.displayDupInstructions.get()) {
|
||||
if (!value.hasSideEffect() || !Configuration.displayDupInstructions.get()) {
|
||||
return value.appendTry(writer, localData);
|
||||
}
|
||||
writer.append("§§dup(");
|
||||
|
||||
@@ -62,4 +62,9 @@ public class PopItem extends GraphTargetItem {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return generator.generate(localData, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSideEffect() {
|
||||
return true; //?
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user