Just kidding - array_merge() is terrible slow
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 1 Feb 2010 22:46:18 +0000 (15:46 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 1 Feb 2010 22:46:18 +0000 (15:46 -0700)
framework/Imap_Client/lib/Horde/Imap/Client/Utils.php

index 78548d6..c00b34b 100644 (file)
@@ -136,7 +136,9 @@ class Horde_Imap_Client_Utils
         while (list(,$val) = each($idarray)) {
             $range = explode(':', $val);
             if (isset($range[1])) {
-                $ids = array_merge($ids, range(min($range), max($range)));
+                for ($i = min($range), $j = max($range); $i <= $j; ++$i) {
+                    $ids[] = $i;
+                }
             } else {
                 $ids[] = $val;
             }