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
|
class VCSDownloadStrategy < AbstractDownloadStrategy
|
||||||
def initialize name, resource
|
def initialize name, resource
|
||||||
super
|
super
|
||||||
specs = resource.specs
|
@ref_type, @ref = destructure_spec_hash(resource.specs)
|
||||||
@ref_type, @ref = specs.dup.shift unless specs.empty?
|
end
|
||||||
|
|
||||||
|
def destructure_spec_hash(spec)
|
||||||
|
spec.each { |o| return o }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user