From a330f424dae06c636c0674b81bbcd021451ee31d Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Mon, 24 Aug 2026 15:59:40 +0200 Subject: [PATCH] Expose zero-GC ClassicAPI aura access --- api.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api.lua b/api.lua index 305050a..dfd3ec5 100644 --- a/api.lua +++ b/api.lua @@ -23,6 +23,9 @@ API.auras = type(_G.C_UnitAuras) == "table" and type(_G.C_UnitAuras.GetAuraDataByIndex) == "function" and type(_G.C_UnitAuras.GetDebuffDataByIndex) == "function" +API.aurapositional = type(_G.C_UnitAuras) == "table" + and type(_G.C_UnitAuras.UnitDebuff) == "function" + API.spellinfo = type(_G.GetSpellInfo) == "function" API.inventory = type(_G.C_Container) == "table" @@ -126,6 +129,14 @@ API.GetDebuffDataByIndex = function(unit, index) end end +-- ClassicAPI's positional UnitDebuff mirrors the Classic-Era 15-value shape +-- without allocating an AuraData table. Prefer it in hot UI refresh paths. +API.UnitDebuff = function(unit, index, filter) + if API.aurapositional then + return _G.C_UnitAuras.UnitDebuff(unit, index, filter) + end +end + API.GetCurrentChatGUID = function() if API.chatidentity then return _G.GetCurrentChatGUID()