-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Bundler::Index
efficiency by removing unnecessary creation and dups
#6931
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
martinemde
force-pushed
the
martinemde/fetch_names_never_overrides
branch
5 times, most recently
from
September 1, 2023 04:43
918f459
to
09bb1e4
Compare
martinemde
changed the title
Refactor Bundler index methods that predictably take the same boolean
Improve Bundle::Index efficient by removing unnecessary creation and dups
Sep 1, 2023
martinemde
changed the title
Improve Bundle::Index efficient by removing unnecessary creation and dups
Improve Bundle::Index efficiency by removing unnecessary creation and dups
Sep 1, 2023
martinemde
force-pushed
the
martinemde/fetch_names_never_overrides
branch
from
September 1, 2023 04:46
09bb1e4
to
c2e81e8
Compare
martinemde
commented
Sep 1, 2023
martinemde
force-pushed
the
martinemde/fetch_names_never_overrides
branch
from
September 1, 2023 17:19
c2e81e8
to
9ee5ee6
Compare
martinemde
force-pushed
the
martinemde/fetch_names_never_overrides
branch
from
September 6, 2023 19:23
9ee5ee6
to
75166db
Compare
segiddins
approved these changes
Sep 6, 2023
martinemde
force-pushed
the
martinemde/fetch_names_never_overrides
branch
from
September 6, 2023 22:31
75166db
to
f12da3e
Compare
Rename Index#use(override = true) to #merge! Rename Index @all_specs to @Duplicates, it is not actually all specs. @Duplicates only holds specs that would have been overridden during a call to Index#use or Index#merge! Reduced dupes in @Duplicates by not double adding the new spec to the index and the @Duplicates during #merge! Reduce Array creation by using specialized methods when the one result or no results are needed from the search.
When @allow_cached is true, @allow_local is always true, therefore, the #installed_specs will always be merged after #cached_specs is called. This makes starting with installed_specs.dup redundant. When #cached_specs is called because @allow_remote is true and @allow_cached is false, then installed_specs will be added after cached_specs based on @allow_local. We never need to add installed_specs here, so don't.
martinemde
force-pushed
the
martinemde/fetch_names_never_overrides
branch
from
September 6, 2023 22:58
f12da3e
to
49b38f9
Compare
deivid-rodriguez
changed the title
Improve Bundle::Index efficiency by removing unnecessary creation and dups
Improve Sep 21, 2023
Bundler::Index
efficiency by removing unnecessary creation and dups
deivid-rodriguez
pushed a commit
that referenced
this pull request
Sep 21, 2023
…verrides Improve Bundle::Index efficiency by removing unnecessary creation and dups (cherry picked from commit 0e54343)
deivid-rodriguez
pushed a commit
that referenced
this pull request
Sep 21, 2023
…verrides Improve Bundle::Index efficiency by removing unnecessary creation and dups (cherry picked from commit 0e54343)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the end-user or developer problem that led to this PR?
Bundler::Source::Rubygems#fetch_names
was always called with override_dupes set to false.Bundler::Index
had two versions of#use
that did were semantically different enough to split into two methods.What is your fix for the problem, implemented in this PR?
Refactor these methods to make them easier to understand.
Change the name of Index @all_specs to be called
@duplicates
because it does not contain all specs, but only specs that have been found as duplicates.Make sure the following tasks are checked