optimize check_case_conflict.parents

This commit is contained in:
Guy Kisel 2021-07-09 12:26:07 -07:00
parent e71fd49e70
commit 8a4333fcff
1 changed files with 5 additions and 4 deletions

View File

@ -15,10 +15,11 @@ def lower_set(iterable: Iterable[str]) -> Set[str]:
def parents(file: str) -> Iterator[str]:
file = os.path.dirname(file)
while file:
yield file
file = os.path.dirname(file)
path_parts = file.split('/')
path_parts.pop()
while path_parts:
yield '/'.join(path_parts)
path_parts.pop()
def directories_for(files: Set[str]) -> Set[str]: