Skip to content

Commit 914e55c

Browse files
committed
Do more expensive check last
Since `isfile` does file IO, do it last.
1 parent 1bcc8c9 commit 914e55c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trailing_spaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def freeze_last_version(self, view):
434434
file_name = view.file_name()
435435
# For some reasons, the on_activated hook gets fired on a ghost document
436436
# from time to time.
437-
if file_name and isfile(file_name) and not view.is_scratch():
437+
if file_name and not view.is_scratch() and isfile(file_name):
438438
on_disk = codecs.open(file_name, "r", "utf-8").read().splitlines()
439439

440440

0 commit comments

Comments
 (0)