diff options
author | Anthony King <anthonydking@slimroms.net> | 2015-04-08 13:22:30 +0100 |
---|---|---|
committer | Anthony King <anthonydking@slimroms.net> | 2015-04-08 13:22:34 +0100 |
commit | 6ad6dbefe79196f0d7bb717fa9279837083e9113 (patch) | |
tree | a2c8b2c570bf83bca1d08b6e7c0394369d8c1565 /subcmds/forall.py | |
parent | 33fe4e99f95125a0083e97c4c143d1fb5134cf36 (diff) | |
download | git-repo-6ad6dbefe79196f0d7bb717fa9279837083e9113.tar.gz |
forall: use a generator to map the Pool
Before, a list was generated, which is why there was a massive delay.
Using a generator will allow processes to start straight away
Change-Id: Ia325b0b340cc328c08c9bcc92a6709bbdaf6a664
Diffstat (limited to 'subcmds/forall.py')
-rw-r--r-- | subcmds/forall.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py index 7771ec16..88b23fbd 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
@@ -212,8 +212,8 @@ without iterating through the remaining projects. | |||
212 | config = self.manifest.manifestProject.config | 212 | config = self.manifest.manifestProject.config |
213 | results_it = pool.imap( | 213 | results_it = pool.imap( |
214 | DoWorkWrapper, | 214 | DoWorkWrapper, |
215 | [[mirror, opt, cmd, shell, cnt, config, self._SerializeProject(p)] | 215 | ([mirror, opt, cmd, shell, cnt, config, self._SerializeProject(p)] |
216 | for cnt, p in enumerate(projects)] | 216 | for cnt, p in enumerate(projects)) |
217 | ) | 217 | ) |
218 | pool.close() | 218 | pool.close() |
219 | for r in results_it: | 219 | for r in results_it: |