Skip to content

Suggestion for optimize function #3

Description

@SolusJiang

replaces calls to global functions with calls to local functions and generates a single line of local variable assignments at the top

so something like :

local function doSomething(s)
      s = string.rep(s, 100)
      print(s)
end

turns into

local string_rep, pring = string.rep, print
local function doSomething(s)
      s = string_rep(s, 100)
      print(s)
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions