Commit 1e610fb
authored
Use `_make_child_entry()` rather than `_make_child_relpath()` to retrieve
path objects for directories to visit. This saves the allocation of one
path object per directory in user subclasses of `PathBase`, and avoids a
second loop.
This trick does not apply when walking top-down, because users can affect
the walk by modifying *dirnames* in-place.
A side effect of this change is that, in bottom-up mode, subdirectories of
each directory are visited in reverse order, and that this order doesn't
match that of the names in *dirnames*. I suspect this is fine as the
order is arbitrary anyway.
1 parent 6313cdd commit 1e610fb
File tree
2 files changed
+7
-4
lines changed- Lib/pathlib
- Misc/NEWS.d/next/Library
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| 823 | + | |
| 824 | + | |
823 | 825 | | |
824 | 826 | | |
825 | 827 | | |
| |||
828 | 830 | | |
829 | 831 | | |
830 | 832 | | |
| 833 | + | |
| 834 | + | |
831 | 835 | | |
832 | 836 | | |
833 | 837 | | |
834 | 838 | | |
835 | 839 | | |
836 | 840 | | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
| 841 | + | |
841 | 842 | | |
842 | 843 | | |
843 | 844 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments