util.pluginloader: Return full file path from internal file loader on success, not...
[prosody.git] / util / array.lua
index bbf26f3214ae4992beda62004503641df6ca04d4..6c1f04606642bc5cdb700f36e289a0aa655d319e 100644 (file)
@@ -1,13 +1,13 @@
 -- Prosody IM
--- Copyright (C) 2008-2009 Matthew Wild
--- Copyright (C) 2008-2009 Waqas Hussain
+-- Copyright (C) 2008-2010 Matthew Wild
+-- Copyright (C) 2008-2010 Waqas Hussain
 -- 
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
 
-local t_insert, t_sort, t_remove, t_concat 
-       = table.insert, table.sort, table.remove, table.concat;
+local t_insert, t_sort, t_remove, t_concat
+    = table.insert, table.sort, table.remove, table.concat;
 
 local array = {};
 local array_base = {};
@@ -43,7 +43,7 @@ function array_base.filter(outa, ina, func)
                end
        end
        
-       if inplace and write < start_length then
+       if inplace and write <= start_length then
                for i=write,start_length do
                        outa[i] = nil;
                end
@@ -111,7 +111,6 @@ end
 
 -- Setup methods from array_base
 for method, f in pairs(array_base) do
-       local method = method; -- Yes, this is necessary :)
        local base_method = f;
        -- Setup global array method which makes new array
        array[method] = function (old_a, ...)