From d1e56b92069f2ffc6c0617c03f1ad3f7508e7101 Mon Sep 17 00:00:00 2001 From: belliash Date: Thu, 19 Jul 2018 16:52:39 +0200 Subject: [PATCH] sizeof() is enough --- hashmap.c | 1 - vm.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hashmap.c b/hashmap.c index 6758345..08035a6 100644 --- a/hashmap.c +++ b/hashmap.c @@ -5482,7 +5482,6 @@ static int ph7_hashmap_walk_recursive(ph7_context *pCtx, int nArg, ph7_value **a * Table of hashmap functions. */ static const ph7_builtin_func aHashmapFunc[] = { - {"count", ph7_hashmap_count }, {"sizeof", ph7_hashmap_count }, {"array_key_exists", ph7_hashmap_key_exists }, {"array_pop", ph7_hashmap_pop }, diff --git a/vm.c b/vm.c index f82c7b9..502edb8 100644 --- a/vm.c +++ b/vm.c @@ -1106,7 +1106,7 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i "function array_merge_recursive($array1, $array2){"\ "if( func_num_args() < 1 ){ return NULL; }"\ "$arrays = func_get_args();"\ - "$narrays = count($arrays);"\ + "$narrays = sizeof($arrays);"\ "$ret = $arrays[0];"\ "for ($i = 1; $i < $narrays; $i++) {"\ " if( array_same($ret,$arrays[$i]) ){ /* Same instance */continue;}"\