util.array: Make array:reverse() and array:shuffle() return the array to allow chaining
authorMatthew Wild <mwild1@gmail.com>
Sat, 20 Jun 2009 21:45:07 +0000 (22:45 +0100)
committerMatthew Wild <mwild1@gmail.com>
Sat, 20 Jun 2009 21:45:07 +0000 (22:45 +0100)
util/array.lua

index 11ff651caf95c61fc79dc53fd0100ebea6e1d23a..8b9102bf13da9ec8f08c5310a61350733e6e7199 100644 (file)
@@ -42,6 +42,7 @@ function array:shuffle()
                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 @@ function array:reverse()
                self:push(self[i]);
                self:pop(i);
        end
+       return self;
 end
 
 function array:append(array)