Hi Xinchen,
The code I used was simply derived from the code of the array_slice
implementation (totally analogous).
Maybe your suggested changes (check HASH_FLAG_PACKED fist + Z_TRY_ADDREF)
should be carried over to array_slice then as well.
Please go ahead and commit a patch, I'd prefer to sti
Hey:
On Wed, Jul 27, 2016 at 10:42 PM, Benjamin Coutu
wrote:
> Hello Xinchen,
>
> Analogue to the array_slice implementation, the array_reverse function
> could also be optimized for packed hash tables when preserve_keys is false
> (most common).
> The following patch should do just that:
>
> if
Hello Xinchen,
Analogue to the array_slice implementation, the array_reverse function could
also be optimized for packed hash tables when preserve_keys is false (most
common).
The following patch should do just that:
if (!preserve_keys && (Z_ARRVAL_P(input)->u.flags & HASH_FLAG_PACKED)) {