Closed elisee closed 11 years ago
By the way, is there a reason why table.objs is a list [] rather than a dictionary {}?
Looking up object keys is probably much slower than it could be because of that. After a cursory look at the source, I can't see a good reason for that, considering Lua makes no guarantee as to the orders in which key/value pairs are returned when using pairs():
The pairs() function will allow iteration over key-value pairs. Note that the order that items are returned is not defined, not even for indexed tables.
(Source: http://lua-users.org/wiki/ForTutorial)
I'll try changing that in my fork and will submit a pull request if it works out.
I merged the latest changes. Any news on getting this into master? :)
Sorry, totally forgot about this.
I've added your change, minus the parenthesis (not the style I've been using in this project). Thank you for your patience!
Thanks for merging!
myTable[key] = nil should never add key/nil to the table's objs, as it's supposed to be used for clearing table-as-dictionary entries.
This pull request fixes that be making sure bFound will always be true if value == null, which will prevent the nil value from being added to the table.