From 88d0f7bf741da9653f56ea0adb315aee27427a6c Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 20 Jul 2026 21:35:31 -0500 Subject: [PATCH] Use table.wipe to reset spell caches Clear existing spell cache tables with table.wipe instead of creating new tables when LEARNED_SPELL_IN_TAB fires. This preserves existing table references (spellmaxrank, spellindex, spellinfo), avoiding stale references and potential bugs while being slightly more efficient. Change applied in libs/libspell.lua. --- libs/libspell.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/libspell.lua b/libs/libspell.lua index dbb21e27..53e148bf 100644 --- a/libs/libspell.lua +++ b/libs/libspell.lua @@ -118,7 +118,9 @@ end local resetcache = CreateFrame("Frame") resetcache:RegisterEvent("LEARNED_SPELL_IN_TAB") resetcache:SetScript("OnEvent", function() - spellmaxrank, spellindex, spellinfo = {}, {}, {} + table.wipe(spellmaxrank) + table.wipe(spellindex) + table.wipe(spellinfo) end) -- add libspell to pfUI API