diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-04-13 20:34:24 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-04-14 19:24:48 -0500 |
commit | f898372166bfe8b77a647a6324dcc4b5e9e8e1c8 (patch) | |
tree | cb09197906e6702a80699ba168e9304eeda9feb7 | |
parent | 50e899d898ab42151ed02e64defeb4bda530b88f (diff) | |
download | bundler-f898372166bfe8b77a647a6324dcc4b5e9e8e1c8.tar.gz |
[SepcSet] Avoid compacting when the array never contains nil
-rw-r--r-- | lib/bundler/spec_set.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 0c54ac7556..bd962922ea 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -83,14 +83,15 @@ module Bundler next s unless s.is_a?(LazySpecification) s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=) spec = s.__materialize__ - if missing_specs - missing_specs << s unless spec - else - raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec + unless spec + unless missing_specs + raise GemNotFound, "Could not find #{s.full_name} in any of the sources" + end + missing_specs << s end - spec if spec + spec end - SpecSet.new(materialized.compact) + SpecSet.new(missing_specs ? materialized.compact : materialized) end # Materialize for all the specs in the spec set, regardless of what platform they're for |