Skip to content

Commit

Permalink
refactoring code with For Else
Browse files Browse the repository at this point in the history
refactoring code with For Else which is more pythonic, concise and efficient than break
  • Loading branch information
idiomaticrefactoring committed Mar 10, 2022
1 parent 8a5054f commit 1d53dca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sublime_jedi/utils.py
Expand Up @@ -166,13 +166,11 @@ def get_project_file_name(window):
folders = project_json['folders']
found_all = True
for directory in window.folders():
found = False
for folder in folders:
folder_path = re.sub(r'^/([^/])/', '\\1:/', folder['path'])
folder_path = re.sub('^/([^/])/', '\\1:/', folder['path'])
if folder_path == directory.replace('\\', '/'):
found = True
break
if not found:
else:
found_all = False
break

Expand Down

0 comments on commit 1d53dca

Please sign in to comment.