mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 19:19:59 +00:00
performance improvement
- Changed SpellInfo to GetSpellRecField (it's twice as fast and has less impact on performance) - different caching method for buffs/debuffs
This commit is contained in:
+8
-7
@@ -398,7 +398,7 @@ local function GetDebuffSlotMap(guid)
|
||||
-- Check cache first
|
||||
local now = GetTime()
|
||||
local cached = slotMapCache[guid]
|
||||
if cached and (now - cached.timestamp) < SLOT_MAP_CACHE_DURATION then
|
||||
if cached and cached.map and (now - cached.timestamp) < SLOT_MAP_CACHE_DURATION then
|
||||
return cached.map
|
||||
end
|
||||
|
||||
@@ -420,7 +420,7 @@ local function GetDebuffSlotMap(guid)
|
||||
local spellId = auras[auraSlot]
|
||||
if spellId and spellId > 0 then
|
||||
displaySlot = displaySlot + 1
|
||||
local spellName = SpellInfo(spellId)
|
||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or SpellInfo(spellId)
|
||||
local texture = libdebuff:GetSpellIcon(spellId)
|
||||
|
||||
-- Get stacks from auraApplications (0-indexed, so +1 for display)
|
||||
@@ -446,11 +446,12 @@ local function GetDebuffSlotMap(guid)
|
||||
end
|
||||
end
|
||||
|
||||
-- Cache the result
|
||||
slotMapCache[guid] = {
|
||||
map = map,
|
||||
timestamp = now
|
||||
}
|
||||
-- Cache the result (separate from buffMap to avoid cross-invalidation)
|
||||
if not slotMapCache[guid] then
|
||||
slotMapCache[guid] = { timestamp = now }
|
||||
end
|
||||
slotMapCache[guid].map = map
|
||||
slotMapCache[guid].timestamp = now
|
||||
|
||||
return map
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user