mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
cleanup: leverage yield from in more places
Change-Id: I4f9cb27d89241d3738486764817b51981444a903 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390274 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
49c9b06838
commit
8dd8521854
@ -476,8 +476,7 @@ class Command:
|
|||||||
top = self.manifest
|
top = self.manifest
|
||||||
yield top
|
yield top
|
||||||
if not opt.this_manifest_only:
|
if not opt.this_manifest_only:
|
||||||
for child in top.all_children:
|
yield from top.all_children
|
||||||
yield child
|
|
||||||
|
|
||||||
|
|
||||||
class InteractiveCommand(Command):
|
class InteractiveCommand(Command):
|
||||||
|
@ -857,8 +857,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|||||||
self._Load()
|
self._Load()
|
||||||
outer = self._outer_client
|
outer = self._outer_client
|
||||||
yield outer
|
yield outer
|
||||||
for tree in outer.all_children:
|
yield from outer.all_children
|
||||||
yield tree
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def all_children(self):
|
def all_children(self):
|
||||||
@ -867,8 +866,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|||||||
for child in self._submanifests.values():
|
for child in self._submanifests.values():
|
||||||
if child.repo_client:
|
if child.repo_client:
|
||||||
yield child.repo_client
|
yield child.repo_client
|
||||||
for tree in child.repo_client.all_children:
|
yield from child.repo_client.all_children
|
||||||
yield tree
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path_prefix(self):
|
def path_prefix(self):
|
||||||
|
@ -193,10 +193,9 @@ def _walk_windows_impl(top, topdown, onerror, followlinks):
|
|||||||
for name in dirs:
|
for name in dirs:
|
||||||
new_path = os.path.join(top, name)
|
new_path = os.path.join(top, name)
|
||||||
if followlinks or not islink(new_path):
|
if followlinks or not islink(new_path):
|
||||||
for x in _walk_windows_impl(
|
yield from _walk_windows_impl(
|
||||||
new_path, topdown, onerror, followlinks
|
new_path, topdown, onerror, followlinks
|
||||||
):
|
)
|
||||||
yield x
|
|
||||||
if not topdown:
|
if not topdown:
|
||||||
yield top, dirs, nondirs
|
yield top, dirs, nondirs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user