Show More
@@ -2655,9 +2655,7 b' class _generatorset(object):' | |||
|
2655 | 2655 | |
|
2656 | 2656 | def __iter__(self): |
|
2657 | 2657 | if self._finished: |
|
2658 |
|
|
|
2659 | yield x | |
|
2660 | return | |
|
2658 | return iter(self._genlist) | |
|
2661 | 2659 | |
|
2662 | 2660 | # We have to use this complex iteration strategy to allow multiple |
|
2663 | 2661 | # iterations at the same time. We need to be able to catch revision |
@@ -2665,16 +2663,18 b' class _generatorset(object):' | |||
|
2665 | 2663 | # |
|
2666 | 2664 | # Getting rid of it would provide an about 15% speed up on this |
|
2667 | 2665 | # iteration. |
|
2668 | i = 0 | |
|
2669 | 2666 | genlist = self._genlist |
|
2670 | 2667 | nextrev = self._consumegen().next |
|
2671 | 2668 | _len = len # cache global lookup |
|
2672 |
|
|
|
2673 |
|
|
|
2674 | yield genlist[i] | |
|
2675 | else: | |
|
2676 |
yield |
|
|
2677 |
|
|
|
2669 | def gen(): | |
|
2670 | i = 0 | |
|
2671 | while True: | |
|
2672 | if i < _len(genlist): | |
|
2673 | yield genlist[i] | |
|
2674 | else: | |
|
2675 | yield nextrev() | |
|
2676 | i += 1 | |
|
2677 | return gen() | |
|
2678 | 2678 | |
|
2679 | 2679 | def _consumegen(self): |
|
2680 | 2680 | cache = self._cache |
General Comments 0
You need to be logged in to leave comments.
Login now