Skip to content

Commit 0038d6e

Browse files
committed
Back this out, it isn't a function call, and isn't expensive. 👋
1 parent 9cac03f commit 0038d6e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/statements.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,8 @@ func (fc *funcContext) translateStmt(stmt ast.Stmt, label *types.Label) {
212212
fc.Printf("%s = 0;", iVar)
213213
keysVar := fc.newVariable("_keys")
214214
fc.Printf("%s = %s ? %s.keys() : [];", keysVar, refVar, refVar)
215-
sizeVar := fc.newVariable("_size")
216-
fc.Printf("%s = %s.size", sizeVar, refVar)
217215

218-
fc.translateLoopingStmt(func() string { return iVar + " < " + sizeVar }, s.Body, func() {
216+
fc.translateLoopingStmt(func() string { return iVar + " < " + refVar + ".size" }, s.Body, func() {
219217
keyVar := fc.newVariable("_key")
220218
entryVar := fc.newVariable("_entry")
221219
fc.Printf("%s = %s.next().value;", keyVar, keysVar)

0 commit comments

Comments
 (0)