mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
getn(arg) -> arg.n
This commit is contained in:
@@ -66,7 +66,7 @@ local funcmsg = "expected function or member name"
|
||||
-- pickfirstset() - picks the first non-nil value and returns it
|
||||
|
||||
local function pickfirstset(...)
|
||||
for i=1,getn(arg) do
|
||||
for i=1,arg.n do
|
||||
if arg[i]~=nil then
|
||||
return arg[i]
|
||||
end
|
||||
@@ -124,7 +124,7 @@ local function callfunction(info, tab, methodtype, ...)
|
||||
info.type = tab.type
|
||||
|
||||
if type(method)=="function" then
|
||||
if getn(arg) > 0 then
|
||||
if arg.n > 0 then
|
||||
return method(info, unpack(arg))
|
||||
else
|
||||
return method(info)
|
||||
|
||||
@@ -77,7 +77,7 @@ Dispatchers[0] = function(func)
|
||||
end
|
||||
|
||||
local function safecall(func, ...)
|
||||
return Dispatchers[getn(arg)](func, unpack(arg))
|
||||
return Dispatchers[arg.n](func, unpack(arg))
|
||||
end
|
||||
|
||||
local width_multiplier = 170
|
||||
@@ -140,7 +140,7 @@ end
|
||||
|
||||
-- picks the first non-nil value and returns it
|
||||
local function pickfirstset(...)
|
||||
for i=1,getn(arg) do
|
||||
for i=1,arg.n do
|
||||
if arg[i]~=nil then
|
||||
return arg[i]
|
||||
end
|
||||
@@ -483,7 +483,7 @@ function AceConfigDialog:SelectGroup(appName, ...)
|
||||
local treevalue
|
||||
local treestatus
|
||||
|
||||
for n = 1, getn(arg) do
|
||||
for n = 1, arg.n do
|
||||
local key = arg[n]
|
||||
|
||||
if group.childGroups == "tab" or group.childGroups == "select" then
|
||||
@@ -600,7 +600,7 @@ local function confirmPopup(appName, rootframe, basepath, info, message, func, .
|
||||
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
|
||||
del(info)
|
||||
end
|
||||
local x = getn(arg)
|
||||
local x = arg.n
|
||||
for i = 1, x do
|
||||
t[i] = arg[i] or false
|
||||
end
|
||||
@@ -1442,7 +1442,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
||||
end
|
||||
|
||||
local function BuildPath(path, ...)
|
||||
for i = 1, getn(arg) do
|
||||
for i = 1, arg.n do
|
||||
tinsert(path, arg[i])
|
||||
end
|
||||
end
|
||||
@@ -1849,7 +1849,7 @@ function AceConfigDialog:Open(appName, container, ...)
|
||||
tinsert(path, container)
|
||||
container = nil
|
||||
end
|
||||
for n = 1, getn(arg) do
|
||||
for n = 1, arg.n do
|
||||
tinsert(path, arg[n])
|
||||
end
|
||||
|
||||
@@ -1959,7 +1959,7 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
||||
local BlizOptions = AceConfigDialog.BlizOptions
|
||||
|
||||
local key = appName
|
||||
for n = 1, getn(arg) do
|
||||
for n = 1, arg.n do
|
||||
key = key.."\001"..arg[n]
|
||||
end
|
||||
|
||||
@@ -1974,9 +1974,9 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
||||
|
||||
group:SetTitle(name or appName)
|
||||
group:SetUserData("appName", appName)
|
||||
if getn(arg) > 0 then
|
||||
if arg.n > 0 then
|
||||
local path = {}
|
||||
for n = 1, getn(arg) do
|
||||
for n = 1, arg.n do
|
||||
tinsert(path, arg[n])
|
||||
end
|
||||
group:SetUserData("path", path)
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ if not AceConfigRegistry.callbacks then
|
||||
end
|
||||
|
||||
-- Lua APIs
|
||||
local tinsert, tconcat, getn = table.insert, table.concat, table.getn
|
||||
local tinsert, tconcat = table.insert, table.concat
|
||||
local strfind, strmatch = string.find, string.match
|
||||
local type, tostring, pairs, unpack = type, tostring, pairs, unpack
|
||||
local error, assert = error, assert
|
||||
@@ -44,7 +44,7 @@ AceConfigRegistry.validated = {
|
||||
|
||||
local function err(msg, errlvl, ...)
|
||||
local t = {}
|
||||
for i=getn(arg),1,-1 do
|
||||
for i=arg.n,1,-1 do
|
||||
tinsert(t, arg[i])
|
||||
end
|
||||
error(MAJOR..":ValidateOptionsTable(): "..tconcat(t,".")..msg, errlvl+2)
|
||||
|
||||
Reference in New Issue
Block a user