summaryrefslogtreecommitdiff
path: root/configure.py
diff options
context:
space:
mode:
authorChristian Clauss <cclauss@me.com>2021-09-06 17:21:16 +0200
committerMichaël Zasso <targos@protonmail.com>2021-09-26 10:59:21 +0200
commitb25a73f26a6b61ad4eee24e47a1db3d00e528955 (patch)
tree1007077c5a6e5caf5fbe3f9e0888e09fd730edb7 /configure.py
parent0e561de643ab38c6a3b5c9912c2abd0b1527c14c (diff)
downloadnode-new-b25a73f26a6b61ad4eee24e47a1db3d00e528955.tar.gz
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure.py b/configure.py
index 9327d6e5f5..6efb98c231 100755
--- a/configure.py
+++ b/configure.py
@@ -1512,7 +1512,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir):
for ent in files:
(path, dirs, files) = ent
for file in files:
- if file.endswith('.cpp') or file.endswith('.c') or file.endswith('.h'):
+ if file.endswith(('.cpp', '.c', '.h')):
# srcfile uses "slash" as dir separator as its output is consumed by gyp
srcfile = '%s/%s' % (dir_sub, file)
if patch_dir: