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-10-04 20:31:27 +0200
commita1bee94502dc4bf1a7e0cd694669180c2ad4b14f (patch)
tree628cfdc11e3b3f97dc756fd7c893ec465554bd96 /configure.py
parentd36127d86291a3990b37b0594bc3f4284d2e7806 (diff)
downloadnode-new-a1bee94502dc4bf1a7e0cd694669180c2ad4b14f.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: