]> granicus.if.org Git - php/commitdiff
count() now uses the new getParamertersEx API.
authorThies C. Arntzen <thies@php.net>
Tue, 14 Sep 1999 13:34:27 +0000 (13:34 +0000)
committerThies C. Arntzen <thies@php.net>
Tue, 14 Sep 1999 13:34:27 +0000 (13:34 +0000)
ChangeLog
ext/standard/basic_functions.c

index 60953939cb9d1803032e1c6c543c97038a00f483..92224328e881b840e4b5ae7d1369b106346b3fd1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ PHP 4.0 CHANGE LOG                                                    ChangeLog
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ?? ?? 1999, Version 4.0 Beta 3
+- count() speedup. (Thies)
 - OCI8 supports appending and positioning when saving LOBs (Thies)
 - Added metaphone support (Thies)
 - OCI8 doesn't use define callbacks any longer. (Thies) 
index e18813609d60b369ecdd352d5ffcaac9aab095b8..aa6544c781d00288d2b99ea7f2cdb83607ffe498 100644 (file)
@@ -705,15 +705,16 @@ PHP_FUNCTION(ksort)
 
 PHP_FUNCTION(count)
 {
-       pval *array;
+       pval **array;
        HashTable *target_hash;
 
-       if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &array) == FAILURE) {
+       if (ARG_COUNT(ht) != 1 || getParametersEx(1, &array) == FAILURE) {
                WRONG_PARAM_COUNT;
        }
-       target_hash = HASH_OF(array);
+
+       target_hash = HASH_OF(*array);
        if (!target_hash) {
-               if (array->type == IS_STRING && array->value.str.val==undefined_variable_string) {
+               if ((*array)->type == IS_STRING && (*array)->value.str.val==undefined_variable_string) {
                        RETURN_LONG(0);
                } else {
                        RETURN_LONG(1);