Skip to content

Commit

Permalink
Merge PR #32: The #= on Symbol and String should be symmetric
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr authored Jan 13, 2023
2 parents 7737658 + 8a451d6 commit b0c8a2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/som/primitives/SymbolPrimitives.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import som.vm.Universe;
import som.vmobjects.SAbstractObject;
import som.vmobjects.SPrimitive;
import som.vmobjects.SString;
import som.vmobjects.SSymbol;


Expand Down Expand Up @@ -57,9 +58,17 @@ public void invoke(final Frame frame, final Interpreter interpreter) {
SSymbol op2 = (SSymbol) frame.pop(); // self
if (op1 == op2) {
frame.push(universe.trueObject);
} else {
frame.push(universe.falseObject);
return;
}

if (op1 instanceof SString) {
SString s = (SString) op1;
if (s.getEmbeddedString().equals(op2.getEmbeddedString())) {
frame.push(universe.trueObject);
return;
}
}
frame.push(universe.falseObject);
}
}, true);
}
Expand Down

1 comment on commit b0c8a2a

@rebenchdb
Copy link

@rebenchdb rebenchdb bot commented on b0c8a2a Jan 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance changes for 7737658...b0c8a2a

Summary Over All Benchmarks
Summary Over All Benchmarks

Full Report

Please sign in to comment.