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

Remove unecessary variable call since sort! always returns the sorted array #10131

Merged
merged 1 commit into from Apr 8, 2013

Conversation

agis
Copy link
Contributor

@agis agis commented Apr 7, 2013

No description provided.

@agis
Copy link
Contributor Author

agis commented Apr 8, 2013

Sooo... @carlosantoniodasilva :)

@dmathieu
Copy link
Contributor

dmathieu commented Apr 8, 2013

You don't even need to use sort!. Using sort would be enough here.
This applies to the helpers variable just below too.

@carlosantoniodasilva
Copy link
Member

@dmathieu at least we avoid creating a few extra objects :).

carlosantoniodasilva added a commit that referenced this pull request Apr 8, 2013
Remove unecessary variable call since `sort!` always returns the sorted array
@carlosantoniodasilva carlosantoniodasilva merged commit d695100 into rails:master Apr 8, 2013
@dmathieu
Copy link
Contributor

dmathieu commented Apr 8, 2013

@carlosantoniodasilva: I'm not saying this is bad. I'm saying we create even less extra objects :)

@vipulnsward
Copy link
Member

@dmathieu sort! is faster than sort, and avoid creating a shallow copy of the original object

@agis agis deleted the metal_helper branch April 8, 2013 13:02
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.

None yet

4 participants