mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 03:38:35 +00:00
Merge pull request #637 from nspcc-dev/feature/optimize_constants
compiler: do not store constants as variables
This commit is contained in:
commit
f69d317036
1 changed files with 5 additions and 1 deletions
|
@ -138,7 +138,11 @@ func (c *codegen) convertGlobals(f ast.Node) {
|
|||
case *ast.FuncDecl:
|
||||
return false
|
||||
case *ast.GenDecl:
|
||||
ast.Walk(c, n)
|
||||
// constants are loaded directly so there is no need
|
||||
// to store them as a local variables
|
||||
if n.Tok != token.CONST {
|
||||
ast.Walk(c, n)
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue