From: Go MAEDA Date: Fri, 7 Jan 2022 01:49:21 +0000 (+0000) Subject: RuboCop: fix Style/RedundantSort in app/models/import.rb (#34718). X-Git-Tag: 5.0.0~115 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e00f28e82e50000e3e6c116c5a218d3f0676f5a7;p=redmine.git RuboCop: fix Style/RedundantSort in app/models/import.rb (#34718). git-svn-id: http://svn.redmine.org/redmine/trunk@21353 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/import.rb b/app/models/import.rb index ffa69d22e..e048867c8 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -70,7 +70,7 @@ class Import < ActiveRecord::Base begin content = File.read(filepath, 256) - separator = [',', ';'].sort_by {|sep| content.count(sep)}.last + separator = [',', ';'].max_by {|sep| content.count(sep)} guessed_encoding = Redmine::CodesetUtil.guess_encoding(file_content) encoding =