VCSDownloadStrategy: destructure spec hash more efficiently

This commit is contained in:
Jack Nagel 2013-10-09 21:41:15 -05:00
parent 6c5a9ae0fb
commit 3cda215881

View File

@ -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