summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-10-03 17:41:47 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-10-03 17:41:47 +0000
commit8581c7328f1795e7b83ce8b09bfdffed49be6df8 (patch)
tree249a92a2ae22605a0783faf01ccd6bb46ed090eb /ext/standard/string.c
parent59fabbb464e799c0aa88e87b3f82b2d7ad96928c (diff)
downloadphp-git-8581c7328f1795e7b83ce8b09bfdffed49be6df8.tar.gz
optimize zend_hash_init() with known hash table sizes.
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index ecd9eea4e7..ee1cdbb845 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2496,7 +2496,7 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
smart_str result = {0};
HashTable tmp_hash;
- zend_hash_init(&tmp_hash, 0, NULL, NULL, 0);
+ zend_hash_init(&tmp_hash, zend_hash_num_elements(hash), NULL, NULL, 0);
zend_hash_internal_pointer_reset_ex(hash, &hpos);
while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) {
switch (zend_hash_get_current_key_ex(hash, &string_key, &string_key_len, &num_key, 0, &hpos)) {