From 616eb83bbabe44d4a7034bcd377d6ee42806c171 Mon Sep 17 00:00:00 2001 From: Matt Schmoyer Date: Sat, 1 Oct 2016 11:36:58 -0400 Subject: Avoid unecessary loop evaluation on empty lines for tidy check_license --- python/tidy/servo_tidy/tidy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/tidy/servo_tidy/tidy.py') diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 30327559e3a..410c0af7ac3 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -149,8 +149,9 @@ def check_license(file_name, lines): l = l.rstrip('\n') if not l.strip(): blank_lines += 1 - if blank_lines >= max_blank_lines: - break + if blank_lines >= max_blank_lines: + break + continue line = uncomment(l) if line is not None: license_block.append(line) -- cgit v1.2.3