Skip to content

Commit

Permalink
Remove unnecessary table_copy in variable support to save memory/cycles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hekili committed Apr 20, 2020
1 parent 83fce27 commit e950892
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,7 @@ do
return db[ key ]
end


state.variable = setmetatable( {}, {
__index = function( t, var )
local debug = Hekili.ActiveDebug
Expand All @@ -3523,14 +3523,12 @@ do

state.variable[ var ] = 0

local varStart = debugprofilestop()

if not db[ var ] then
-- if debug then Hekili:Debug( "var[%s] :: no data.\n%s", var, debugstack() ) end
return 0
end

local data = table_copy( db[ var ] )
local data = db[ var ]
local parent = state.scriptID

-- If we're checking variable with no script loaded, don't bother.
Expand Down

0 comments on commit e950892

Please sign in to comment.