WowRarity / Rarity

Collectibles and statistics tracking addon for World of Warcraft
https://www.curseforge.com/wow/addons/rarity
GNU General Public License v2.0
56 stars 35 forks source link

Avoid creating potentially unnecessary globals for the scanning tooltip #786

Open rdw-software opened 1 month ago

rdw-software commented 1 month ago

Source: Discord (DM)

First time I've seen this when looking at _G, use devtool with, find __Rarity image

Looking at the code, there's one global being created for the tooltip itself: https://github.com/WowRarity/Rarity/blob/05caf4cf4e7b9f0560111aafa3f0c1ad065d020c/Core/GUI.lua#L8

The other globals appear to be indexed directly, one for each tooltip line. It's probably cleaner to store them locally, though?

Not sure why they're global. Maybe a limitation of Blizzard's UI? I'd try moving them into the GUI module to see what happens.