Remove some locals

This commit is contained in:
2016-09-06 18:07:51 +02:00
parent 83abacd2f9
commit 089d270ade

View File

@ -470,7 +470,7 @@ end
function MyBank:UserDropDown_Initialize() function MyBank:UserDropDown_Initialize()
local this = self or _G.this local this = self or _G.this
local chars, char_num, i local chars, char_num
chars = MyBank:GetSortedCharList(MyBank.GetOpt("Sort")) chars = MyBank:GetSortedCharList(MyBank.GetOpt("Sort"))
char_num = getn(chars) char_num = getn(chars)
if (char_num == 0) then if (char_num == 0) then
@ -526,17 +526,19 @@ function MyBank:ToggleAllBags(forceopen)
else else
ToggleBackpack() ToggleBackpack()
end end
local action, i local action
if (IsBagOpen(0) or MyInventory.frame:IsVisible()) then if (IsBagOpen(0) or MyInventory.frame:IsVisible()) then
action = "OpenBag" action = "OpenBag"
else else
action = "CloseBag" action = "CloseBag"
end end
for i = 1, 4, 1 do for i = 1, 4, 1 do
if not (MyInventory.GetOpt("Replace") and MyInventory:IncludeBag(i)) then if not (MyInventory.GetOpt("Replace") and MyInventory:IncludeBag(i)) then
self.hooks[action](i) self.hooks[action](i)
end end
end end
for i = 5, 11, 1 do for i = 5, 11, 1 do
if not MyBank.GetOpt("Replace") or not MyBank:IncludeBag(i) then if not MyBank.GetOpt("Replace") or not MyBank:IncludeBag(i) then
self.hooks[action](i) self.hooks[action](i)
@ -609,7 +611,6 @@ end
function MyBank:GetSortedCharList(sorttype, realm) function MyBank:GetSortedCharList(sorttype, realm)
if IsAddOnLoaded("DataStore_Containers") then if IsAddOnLoaded("DataStore_Containers") then
local realmname
local realmlist = {} local realmlist = {}
local realmcount = 0 local realmcount = 0
if not realm then if not realm then
@ -623,8 +624,6 @@ function MyBank:GetSortedCharList(sorttype, realm)
end end
local result = {} local result = {}
local idx = 0 local idx = 0
local i
local charname, charkey
for i = 1, realmcount do for i = 1, realmcount do
for charname, charkey in pairs(DataStore:GetCharacters(realmlist[i])) do for charname, charkey in pairs(DataStore:GetCharacters(realmlist[i])) do
-- charkey = DataStore:GetCharacter(charname, realmlist[i]) -- charkey = DataStore:GetCharacter(charname, realmlist[i])