Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Remove ksort in pool results that modifies intended original order #37775

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

lukeb
Copy link
Contributor

@lukeb lukeb commented Jun 22, 2021

Bug Report: #37774

@GrahamCampbell GrahamCampbell changed the title remove ksort in pool results that modifies intended original order [8.x] Remove ksort in pool results that modifies intended original order Jun 22, 2021
@taylorotwell
Copy link
Member

Why do they need to be in the same "order"... it is an associative array so they should be accessed by their named keys anyways?

@lukeb
Copy link
Contributor Author

lukeb commented Jun 22, 2021

While this was a simplistic example for the bug report, there are more complex use cases that use the as('string') method and yet still should retain the originally intended order in the results. There is no reason to reorder them.

For our case, we're importing large numbers of real estate listing photos. When the pool requests complete, we're piping the collection through additional map() callbacks and it must maintain the photo order the listing agent desires.

Removing the ksort doesn't change anything with numerically keyed array of requests either. Ultimately, ksort isn't necessary.

@taylorotwell taylorotwell merged commit 0c4d197 into laravel:8.x Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants