Quantcast WoWInterface - View Single Post - Memory Leak ?
Thread: Memory Leak ?
View Single Post
05-05-17, 01:58 AM   #11
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,214
Using table[somevar] = "something" is great for accessing unknown table keys. If you know the key you want to use you can access it with dot notation table.key = "something"

Example in your case:
Lua Code:
  1. if C_Garrison.GetGarrisonInfo(TYPE70) then
  2.         LEGION["avl"] = #GetAvailableMissions(FOLTYPE70)
  3.         LEGION["pro"] = #GetInProgressMissions(FOLTYPE70)
  4.         LEGION["fin"] = #GetCompleteMissions(FOLTYPE70)
  5. end
could be:
Lua Code:
  1. if C_Garrison.GetGarrisonInfo(TYPE70) then
  2.         LEGION.avl = #GetAvailableMissions(FOLTYPE70)
  3.         LEGION.pro = #GetInProgressMissions(FOLTYPE70)
  4.         LEGION.fin = #GetCompleteMissions(FOLTYPE70)
  5. end

Just an FYI.
Then again, I dislike wasting keystrokes like using brackets around if statements or ending lines with semicolons etc. .
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-05-17 at 02:35 AM.
  Reply With Quote