attempted optimizations
This commit is contained in:
@@ -19,24 +19,6 @@ local band = bit.band
|
||||
|
||||
local tempTable1 = { }
|
||||
|
||||
-- Generate a UUID for a skill
|
||||
local function cacheSkillUUID(skill)
|
||||
local strName = skill.activeEffect.grantedEffect.name:gsub("%s+", "") -- strip spaces
|
||||
local strSlotName = (skill.slotName or "NO_SLOT"):gsub("%s+", "") -- strip spaces
|
||||
local indx = 1
|
||||
if skill.socketGroup and skill.socketGroup.gemList and skill.activeEffect.gemData then
|
||||
for idx, gem in ipairs(skill.socketGroup.gemList) do
|
||||
-- we compare table addresses rather than names since two of the same gem
|
||||
-- can be socketed in the same slot
|
||||
if gem.gemData == skill.activeEffect.gemData then
|
||||
indx =idx
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
return strName.."_"..strSlotName.."_"..tostring(indx)
|
||||
end
|
||||
|
||||
-- Identify the trigger action skill for trigger conditions, take highest Attack Per Second
|
||||
local function findTriggerSkill(skill, source, triggerRate)
|
||||
local uuid = cacheSkillUUID(skill)
|
||||
|
||||
@@ -115,13 +115,34 @@ function calcs.getMiscCalculator(build)
|
||||
end, baseOutput
|
||||
end
|
||||
|
||||
-- Generate a UUID for a skill
|
||||
function cacheSkillUUID(skill)
|
||||
local strName = skill.activeEffect.grantedEffect.name:gsub("%s+", "") -- strip spaces
|
||||
local strSlotName = (skill.slotName or "NO_SLOT"):gsub("%s+", "") -- strip spaces
|
||||
local indx = 1
|
||||
if skill.socketGroup and skill.socketGroup.gemList and skill.activeEffect.gemData then
|
||||
for idx, gem in ipairs(skill.socketGroup.gemList) do
|
||||
-- we compare table addresses rather than names since two of the same gem
|
||||
-- can be socketed in the same slot
|
||||
if gem.gemData == skill.activeEffect.gemData then
|
||||
indx =idx
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
return strName.."_"..strSlotName.."_"..tostring(indx)
|
||||
end
|
||||
|
||||
-- Build output for display in the side bar or calcs tab
|
||||
function calcs.buildOutput(build, mode)
|
||||
local fullEnv = calcs.initEnv(build, mode)
|
||||
for _, activeSkill in ipairs(fullEnv.player.activeSkillList) do
|
||||
fullEnv.player.mainSkill = activeSkill
|
||||
calcs.perform(fullEnv)
|
||||
fullEnv = calcs.initEnv(build, mode)
|
||||
local uuid = cacheSkillUUID(activeSkill)
|
||||
if not GlobalCache[uuid] then
|
||||
fullEnv.player.mainSkill = activeSkill
|
||||
calcs.perform(fullEnv)
|
||||
fullEnv = calcs.initEnv(build, mode)
|
||||
end
|
||||
end
|
||||
|
||||
-- Build output
|
||||
|
||||
Reference in New Issue
Block a user