Skip to content
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

use set for membership queries #4459

Merged
merged 2 commits into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions conda_build/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,9 @@ def index_subdir(self, subdir, index_file=None, verbose=False, progress=False):
)
# unchanged_set: packages in old repodata whose information can carry straight
# across to new repodata
unchanged_set = sorted(old_repodata_fns - update_set - remove_set - ignore_set)
unchanged_set = set(old_repodata_fns - update_set - remove_set - ignore_set)

assert isinstance(unchanged_set, set) # faster `in` queries

# clean up removed files
removed_set = (old_repodata_fns - fns_in_subdir)
Expand All @@ -937,7 +939,7 @@ def index_subdir(self, subdir, index_file=None, verbose=False, progress=False):
new_repodata_packages = {k: v for k, v in old_repodata.get('packages', {}).items() if k in unchanged_set}
new_repodata_conda_packages = {k: v for k, v in old_repodata.get('packages.conda', {}).items() if k in unchanged_set}

for k in unchanged_set:
for k in sorted(unchanged_set):
if not (k in new_repodata_packages or k in new_repodata_conda_packages):
fn, rec = ChannelIndex._load_index_from_cache(self.channel_root, subdir, fn, stat_cache)
# this is how we pass an exception through. When fn == rec, there's been a problem,
Expand Down