Graph: small refactoring

This commit is contained in:
Valery Sizov 2011-11-13 15:31:18 +02:00
parent c89682605f
commit dc844f0138
2 changed files with 6 additions and 10 deletions

View file

@ -181,7 +181,10 @@ class ProjectsController < ApplicationController
def add_refs(commit, ref_cache)
if ref_cache.empty?
@repo.refs.each {|ref| ref_cache[ref.commit.id] ||= [];ref_cache[ref.commit.id] << ref}
@repo.refs.each do |ref|
ref_cache[ref.commit.id] ||= []
ref_cache[ref.commit.id] << ref
end
end
commit.refs = ref_cache[commit.id] if ref_cache.include? commit.id
commit.refs ||= []

View file

@ -72,11 +72,4 @@ class GraphCommit
marks.compact.max
end
def self.add_refs(commit, ref_cache)
if ref_cache.empty?
@repo.refs.each {|ref| ref_cache[ref.commit.id] ||= [];ref_cache[ref.commit.id] << ref}
end
commit.refs = ref_cache[commit.id] if ref_cache.include? commit.id
commit.refs ||= []
end
end