Skip to content

Commit a1bee94

Browse files
cclausstargos
authored andcommittedOct 4, 2021
build: pass a tuple of alternatives to str.endswith()
https://docs.python.org/3/library/stdtypes.html#str.endswith One function call should be faster than three function calls per file. PR-URL: #40017 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent d36127d commit a1bee94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎configure.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir):
15121512
for ent in files:
15131513
(path, dirs, files) = ent
15141514
for file in files:
1515-
if file.endswith('.cpp') or file.endswith('.c') or file.endswith('.h'):
1515+
if file.endswith(('.cpp', '.c', '.h')):
15161516
# srcfile uses "slash" as dir separator as its output is consumed by gyp
15171517
srcfile = '%s/%s' % (dir_sub, file)
15181518
if patch_dir:

0 commit comments

Comments
 (0)
Please sign in to comment.