Unset frame storage on channel hide to prevent uneeded iteration."

This commit is contained in:
Andrew Tomaka 2011-05-27 21:49:47 -04:00
parent b9c46370a6
commit 476a5e4398

View file

@ -34,13 +34,11 @@ function core:RejoinChannels(...)
currentChannels[select(i,GetChannelList())] = true currentChannels[select(i,GetChannelList())] = true
end end
for channel,information in pairs(ChatSaverDB) do for channel,_ in pairs(ChatSaverDB) do
if(currentChannels[channel] == nil) then if(currentChannels[channel] == nil) then
JoinPermanentChannel(channel); JoinPermanentChannel(channel);
for index,shown in pairs(ChatSaverDB[channel].frames) do for index,_ in pairs(ChatSaverDB[channel].frames) do
if(shown) then ChatFrame_AddChannel(_G['ChatFrame'..index],channel);
ChatFrame_AddChannel(_G['ChatFrame'..index],channel);
end
end end
end end
end end
@ -99,6 +97,6 @@ function core:ToggleChatChannel(checked,channel)
if(checked) then if(checked) then
ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = true; ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = true;
else else
ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = false; ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = nil;
end end
end end