mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 10:41:42 +00:00
Notes on unary EQZ in compileBinary EQ
This commit is contained in:
@ -1545,6 +1545,11 @@ export class Compiler extends DiagnosticEmitter {
|
||||
|
||||
case Token.EQUALS_EQUALS:
|
||||
case Token.EQUALS_EQUALS_EQUALS:
|
||||
|
||||
// NOTE that this favors correctness, in terms of emitting a binary expression, over
|
||||
// checking for a possible use of unary EQZ. while the most classic of all optimizations,
|
||||
// that's not what the source told us to do. for reference, `!left` emits unary EQZ.
|
||||
|
||||
left = this.compileExpression(expression.left, contextualType, ConversionKind.NONE);
|
||||
right = this.compileExpression(expression.right, this.currentType);
|
||||
|
||||
|
Reference in New Issue
Block a user