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

Merged
merged 1 commit into from Apr 8, 2013

Projects

None yet

4 participants

@agis-
agis- commented Apr 7, 2013

No description provided.

@agis-
agis- commented Apr 8, 2013
@dmathieu
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

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

@carlosantoniodasilva carlosantoniodasilva merged commit d695100 into rails:master Apr 8, 2013
@dmathieu
dmathieu commented Apr 8, 2013

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

@vipulnsward
Member

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

@agis- agis- deleted the unknown repository branch Apr 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment