]> source.dussan.org Git - redmine.git/commitdiff
RuboCop: fix Style/RedundantSort in app/models/import.rb (#34718).
authorGo MAEDA <maeda@farend.jp>
Fri, 7 Jan 2022 01:49:21 +0000 (01:49 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 7 Jan 2022 01:49:21 +0000 (01:49 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@21353 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/import.rb

index ffa69d22eee2afa1896cbf019bcb2192da4b8b4f..e048867c80d0bf27c80ddf0eef8a7fc9931cbe2b 100644 (file)
@@ -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 =