Refactor: Removing the duplicated code.
This commit is contained in:
parent
79cd1ca304
commit
b7e5f4556b
3 changed files with 38 additions and 46 deletions
|
@ -26,5 +26,14 @@ module Network
|
|||
0
|
||||
end
|
||||
end
|
||||
|
||||
def parents(map)
|
||||
@commit.parents.map do |p|
|
||||
if map.include?(p.id)
|
||||
map[p.id]
|
||||
end
|
||||
end
|
||||
.compact
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue