Skip to content

Commit a1bee94

Browse files
cclausstargos
authored andcommitted
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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
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)