From 262259deb0739f66913f9834288911da175d35e4 Mon Sep 17 00:00:00 2001 From: Alar of Runetotem Date: Fri, 17 Feb 2017 19:13:35 +0100 Subject: [PATCH] No longer installs LibInit 40 --- .pkgmeta | 2 +- Init.lua | 58 +++------------------------------------------------------- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 5f66848..5e0ac26 100755 --- a/.pkgmeta +++ b/.pkgmeta @@ -4,7 +4,7 @@ enable-nolib-creation: no externals: libs/LibInit: url: https://github.com/alarofrunetotem/LibInit.git/LibInit - tag: latest + tag: Release-70100-39 libs/Ace3/AceBucket-3.0: url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceBucket-3.0 diff --git a/Init.lua b/Init.lua index cfcb4b4..02d205d 100644 --- a/Init.lua +++ b/Init.lua @@ -1,7 +1,7 @@ local me, ns = ... local LibInit,minor=LibStub("LibInit",true) assert(LibInit,me .. ": Missing LibInit, please reinstall") -local minvers=40 +local minvers=39 assert(minor>=minvers,me ..': Need at least Libinit version ' .. minvers) local _G=_G local setmetatable=setmetatable @@ -59,60 +59,8 @@ GetQuestsCompleted(ns.quests) function addon:EventQUEST_TURNED_IN(event,quest,item,gold) ns.quests[quest]=true end -do - --@debug@ - local newcount, delcount,createdcount,cached = 0,0,0 - --@end-debug@ - local pool = setmetatable({},{__mode="k"}) - ---@function [parent=#ns] new - function ns.new() - --@debug@ - newcount = newcount + 1 - --@end-debug@ - local t = next(pool) - if t then - pool[t] = nil - return t - else - --@debug@ - createdcount = createdcount + 1 - --@end-debug@ - return {} - end - end - ---@function [parent=#ns] tCopy - function ns.tCopy(t) - local c = ns.new() - for k, v in pairs(t) do - c[k] = v - end - return c - end - ---@function [parent=#ns] del - function ns.del(t) - --@debug@ - delcount = delcount + 1 - --@end-debug@ - wipe(t) - pool[t] = true - end - --@debug@ - ---@function [parent=#ns] cached - function cached() - local n = 0 - for k in pairs(pool) do - n = n + 1 - end - return n - end - function addon:CacheStats() - print("Created:",createdcount) - print("Aquired:",newcount) - print("Released:",delcount) - print("Cached:",cached()) - end - --@end-debug@ -end +ns.new=addon:wrap("newTable") +ns.del=addon:wrap("delTable") -- Caching iteminfo ns.I=LibStub("LibItemUpgradeInfo-1.0") ns.GetItemInfo=ns.I:GetCachingGetItemInfo() -- 1.7.9.5