diff options
author | Christian Clauss <cclauss@me.com> | 2021-09-06 18:21:16 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-09-26 11:59:21 +0300 |
commit | b25a73f26a6b61ad4eee24e47a1db3d00e528955 (patch) | |
tree | 1007077c5a6e5caf5fbe3f9e0888e09fd730edb7 /configure.py | |
parent | 0e561de643ab38c6a3b5c9912c2abd0b1527c14c (diff) |
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-x | configure.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/configure.py b/configure.py index 9327d6e5f5d..6efb98c2316 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: |