felipe                                   Thu, 11 Nov 2010 21:25:34 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=305279

Log:
- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4)

Bug: http://bugs.php.net/47643 (Closed) array_diff() takes over 3000 times 
longer than php 5.2.4
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/ext/standard/array.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2010-11-11 20:37:33 UTC (rev 305278)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-11-11 21:25:34 UTC (rev 305279)
@@ -20,6 +20,8 @@
   (Sriram Natarajan)
 - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
 - Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry)
+- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4).
+  (Felipe)
 - Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy
   with SoapClient object). (Dmitry)


Modified: php/php-src/branches/PHP_5_2/ext/standard/array.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/array.c   2010-11-11 20:37:33 UTC 
(rev 305278)
+++ php/php-src/branches/PHP_5_2/ext/standard/array.c   2010-11-11 21:25:34 UTC 
(rev 305279)
@@ -3842,8 +3842,8 @@
                for (i = 1; i < arr_argc; i++) {
                        Bucket **ptr = ptrs[i];
                        if (behavior == DIFF_NORMAL) {
-                               while (*ptr && (0 < (c = 
diff_data_compare_func(ptrs[0], ptr TSRMLS_CC)))) {
-                                       ptr++;
+                               while (*ptrs[i] && (0 < (c = 
diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+                                       ptrs[i]++;
                                }
                        } else if (behavior & DIFF_ASSOC) { /* triggered also 
when DIFF_KEY */
                                while (*ptr && (0 != (c = 
diff_key_compare_func(ptrs[0], ptr TSRMLS_CC)))) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to