From eee1c36b4b7f0cee23ebc5d3848fa2b606f603c8 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 2 Aug 2018 21:54:21 +0000 Subject: Replace Enumerable#sort with faster Enumerable#sort_by (#29299). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17462 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/repositories_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/helpers/repositories_helper.rb') diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 435041b72..59c97cdc5 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -269,7 +269,7 @@ module RepositoriesHelper :href => block_given? ? yield(commit.scmid) : commit.scmid } end - heads.sort! { |head1, head2| head1.to_s <=> head2.to_s } + heads.sort_by!(&:to_s) space = nil heads.each do |head| if commits_by_scmid.include? head.scmid -- cgit v1.2.3