WoWInterface - View Single Post - how is better to write ...
View Single Post
03-30-20, 03:13 AM   #8
A Pyroguard Emberseer
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,965
Originally Posted by gmarco View Post
And the second question.

Being defined as:

Lua Code:
  1. local dataobj

all its functions are local too automagically or it is better to defined them local too ?

I missed this question and it looks like it hasn't been answered yet. dataobj in your code ends up being a table. Everything in the table are entries. They're neither locals nor globals. In terms of performance, each indexing operation you perform is akin to accessing a global. This also means when you have nested tables, each indexing operation stacks up when you navigate through them to reference an entry.
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote