Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

ArrayUtils performance tweak #6900

Closed

Conversation

Pittiplatsch
Copy link

No description provided.

@@ -257,7 +257,7 @@ public static function iteratorToArray($iterator, $recursive = true)
public static function merge(array $a, array $b, $preserveNumericKeys = false)
{
foreach ($b as $key => $value) {
if (array_key_exists($key, $a)) {
if (isset($a[$key]) || array_key_exists($key, $a)) {
if (is_int($key) && !$preserveNumericKeys) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also swap this conditional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #6905. I saw too late you already closed this one...

@Ocramius Ocramius self-assigned this Nov 20, 2014
@Ocramius Ocramius added this to the 2.3.4 milestone Nov 20, 2014
Ocramius added a commit that referenced this pull request Nov 20, 2014
@Ocramius Ocramius closed this in 9787a11 Nov 20, 2014
@Ocramius
Copy link
Member

@Pittiplatsch merged, thanks!

master: 9787a11
develop: ee83117

@Ocramius Ocramius mentioned this pull request Nov 20, 2014
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants