Remove elements from the commit map instead of just reading them

As each push contains a different set of commits, after we have used a given
commit from the commit map, we'll never use it again.
This commit is contained in:
Marco Castelluccio 2020-06-14 17:32:09 +02:00
Родитель ad848e99f4
Коммит 627192f35f
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -163,7 +163,7 @@ class TestSelectModel(Model):
self.granularity
):
commits = tuple(
commit_map[revision] for revision in revs if revision in commit_map
commit_map.pop(revision) for revision in revs if revision in commit_map
)
if len(commits) == 0:
continue
@ -545,7 +545,7 @@ class TestSelectModel(Model):
# Select tests for all the pushes in the test set.
for i, (rev, push) in enumerate(tqdm(test_pushes.items())):
commits = tuple(
commit_map[revision]
commit_map.pop(revision)
for revision in push["revs"]
if revision in commit_map
)