util.set: :items() now returns an iterator instead of the underlying table. This is much more efficient than 'for item in set' (which still works for now). Current access to _items is generally done directly, this may change.
authorMatthew Wild <mwild1@gmail.com>
Tue, 03 Sep 2013 12:21:43 +0100
changeset 5817 6e087f3b8f3b
parent 5814 5cf1c08805fb
child 5818 5733a277237a
util.set: :items() now returns an iterator instead of the underlying table. This is much more efficient than 'for item in set' (which still works for now). Current access to _items is generally done directly, this may change.
util/set.lua
--- a/util/set.lua	Tue Sep 03 00:20:28 2013 +0100
+++ b/util/set.lua	Tue Sep 03 12:21:43 2013 +0100
@@ -75,7 +75,7 @@
 	end
 
 	function set:items()
-		return items;
+		return next, items;
 	end
 
 	function set:remove(item)