Added comprehension to improve performance

This commit is contained in:
Metehan Çetinkaya 2019-11-20 09:12:42 +03:00 committed by GitHub
parent b741b60b4c
commit 2c37e31d2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,11 +11,8 @@ def concatenate(lang, docs_path, single_page_file):
az_re = re.compile(r'[a-z]')
with open(proj_config) as cfg_file:
files_to_concatenate = []
for l in cfg_file:
if '.md' in l and 'single_page' not in l:
path = (l[l.index(':') + 1:]).strip(" '\n")
files_to_concatenate.append(path)
files_to_concatenate = [(l[l.index(':') + 1:]).strip(" '\n") for l in cfg_file
if '.md' in l and 'single_page' not in l]
logging.info(
str(len(files_to_concatenate)) +