diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-08-08 21:36:39 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-08-08 21:36:39 +0300 |
commit | 6af4efea872407bf7f3957f3009984989a3a8e8f (patch) | |
tree | aad973ce24a02cb62082973abb3c1da09dfd6b1f /app/models/repository.rb | |
parent | a77394a7e526b462057c0ef88e5b8b06b96e2290 (diff) |
Update version_sorter and use new interface for faster tag sorting
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 701f867f67c..e56bac509a4 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -636,9 +636,7 @@ class Repository def tags_sorted_by(value) case value when 'name' - # Would be better to use `sort_by` but `version_sorter` only exposes - # `sort` and `rsort` - VersionSorter.rsort(tag_names).map { |tag_name| find_tag(tag_name) } + VersionSorter.rsort(tags) { |tag| tag.name } when 'updated_desc' tags_sorted_by_committed_date.reverse when 'updated_asc' |