From: Ankit Pati Date: Fri, 9 Mar 2018 18:44:20 +0000 (+0530) Subject: Remove Superfluous Check for Zero-Length List X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=4b5dc8d920842507ff470e7df10348c5257e6d02;p=stevenblack-hosts.git Remove Superfluous Check for Zero-Length List Checking for zero-length is not necessary here as iterating over a zero-length list is perfectly valid, and produces exactly zero iterations, matching the intended behaviour without an extra check. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 1f3a2e52e..e319aa089 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -620,9 +620,8 @@ def update_all_sources(source_data_filename, host_filename): updated_file = get_file_by_url(update_url) # spin the transforms as required - if len(update_transforms) > 0: - for transform in update_transforms: - updated_file = transform_methods[transform](updated_file) + for transform in update_transforms: + updated_file = transform_methods[transform](updated_file) # get rid of carriage-return symbols updated_file = updated_file.replace("\r", "")