Skip to content

Commit

Permalink
Use symbol comparison instead of .equals()
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Dec 3, 2023
1 parent 7ecbcf3 commit 3d74296
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/trufflesom/src/trufflesom/compiler/ParserAst.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import trufflesom.primitives.Primitives;
import trufflesom.vm.Globals;
import trufflesom.vm.NotYetImplementedException;
import trufflesom.vm.SymbolTable;
import trufflesom.vmobjects.SArray;
import trufflesom.vmobjects.SClass;
import trufflesom.vmobjects.SInvokable;
Expand Down Expand Up @@ -313,7 +314,7 @@ protected ExpressionNode binaryMessage(final MethodGenerationContext mgenc,
return inlined;
}

if (msg.getString().equals("+") && operand instanceof IntegerLiteralNode lit) {
if (msg == SymbolTable.symPlus && operand instanceof IntegerLiteralNode lit) {
if (lit.executeLong(null) == 1) {
return IntIncrementNodeGen.create(receiver);
}
Expand Down

0 comments on commit 3d74296

Please sign in to comment.