Changeset

1372:3b13bb57002e

util.array: Make array:reverse() and array:shuffle() return the array to allow chaining
author Matthew Wild <mwild1@gmail.com>
date Sat, 20 Jun 2009 22:45:07 +0100
parents 1371:9e45bdf55353
children 1373:120275376bbb
files util/array.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/array.lua	Sat Jun 20 22:43:54 2009 +0100
+++ b/util/array.lua	Sat Jun 20 22:45:07 2009 +0100
@@ -42,6 +42,7 @@
 		local r = math.random(i,len);
 		self[i], self[r] = self[r], self[i];
 	end
+	return self;
 end
 
 function array:reverse()
@@ -50,6 +51,7 @@
 		self:push(self[i]);
 		self:pop(i);
 	end
+	return self;
 end
 
 function array:append(array)