mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
VCSDownloadStrategy: destructure spec hash more efficiently
This commit is contained in:
parent
6c5a9ae0fb
commit
3cda215881
@ -49,8 +49,11 @@ end
|
||||
class VCSDownloadStrategy < AbstractDownloadStrategy
|
||||
def initialize name, resource
|
||||
super
|
||||
specs = resource.specs
|
||||
@ref_type, @ref = specs.dup.shift unless specs.empty?
|
||||
@ref_type, @ref = destructure_spec_hash(resource.specs)
|
||||
end
|
||||
|
||||
def destructure_spec_hash(spec)
|
||||
spec.each { |o| return o }
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user