]> source.dussan.org Git - redmine.git/commitdiff
Fix RuboCop offense Style/SymbolProc (#37614).
authorGo MAEDA <maeda@farend.jp>
Sun, 25 Sep 2022 04:57:21 +0000 (04:57 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 25 Sep 2022 04:57:21 +0000 (04:57 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@21841 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/git.rb

index d52873745d25c70241ee0db78b36ae6ec239679b..66dea18d916d644e2cd3b28727dcb00265a8e448 100644 (file)
@@ -137,7 +137,7 @@ class Repository::Git < Repository
 
     h1 = extra_info || {}
     h  = h1.dup
-    repo_heads = scm_brs.map{|br| br.scmid}
+    repo_heads = scm_brs.map(&:scmid)
     h["heads"] ||= []
     prev_db_heads = h["heads"].dup
     if prev_db_heads.empty?
@@ -198,10 +198,10 @@ class Repository::Git < Repository
     offset = 0
     revisions_copy = revisions.clone # revisions will change
     while offset < revisions_copy.size
-      scmids = revisions_copy.slice(offset, limit).map{|x| x.scmid}
+      scmids = revisions_copy.slice(offset, limit).map(&:scmid)
       recent_changesets_slice = changesets.where(:scmid => scmids)
       # Subtract revisions that redmine already knows about
-      recent_revisions = recent_changesets_slice.map{|c| c.scmid}
+      recent_revisions = recent_changesets_slice.map(&:scmid)
       revisions.reject!{|r| recent_revisions.include?(r.scmid)}
       offset += limit
     end
@@ -248,7 +248,7 @@ class Repository::Git < Repository
     revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false)
     return [] if revisions.blank?
 
-    changesets.where(:scmid => revisions.map {|c| c.scmid}).to_a
+    changesets.where(:scmid => revisions.map(&:scmid)).to_a
   end
 
   def clear_extra_info_of_changesets