Skip to content

Upvalue moho functions as part of other function calls #6

@ChessBerry

Description

@ChessBerry

Right now function arguments that are themselves functions calls don't get upvalued (as they are not even being looked at).

Hence

self.SetBreakOffTriggerMult(3, self.SetBreakOffDistanceMult(4))

gets turned into

-- Automatically upvalued moho functions for performance
local UnitMethods = _G.moho.unit_methods
local UnitMethodsSetBreakOffDistanceMult = UnitMethods.SetBreakOffDistanceMult
local UnitMethodsSetBreakOffTriggerMult = UnitMethods.SetBreakOffTriggerMult
-- End of automatically upvalued moho functions

UnitMethodsSetBreakOffTriggerMult(3, self.SetBreakOffDistanceMult(4))

but should turn into

-- Automatically upvalued moho functions for performance
local UnitMethods = _G.moho.unit_methods
local UnitMethodsSetBreakOffTriggerMult = UnitMethods.SetBreakOffTriggerMult
-- End of automatically upvalued moho functions

UnitMethodsSetBreakOffTriggerMult(3, UnitMethodsSetBreakOffDistanceMult(4))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions