Diff

util/set.lua @ 5817:6e087f3b8f3b

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.
author Matthew Wild <mwild1@gmail.com>
date Tue, 03 Sep 2013 12:21:43 +0100
parent 5814:5cf1c08805fb
child 5908:081a91507e4f
line wrap: on
line diff
--- 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)