Skip to content

Commit

Permalink
Optimize string.match(regex) to string.test(regex)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed May 14, 2019
1 parent a8397c3 commit 399c42c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/node/generate_build_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function listFiles(rootDir, subDir = '') {
function filterFilesForFilegroup(files, allowedExts = [], excludedExts = []) {
// Files with spaces (\x20) or unicode characters (<\x20 && >\x7E) are not allowed in
// Bazel runfiles. See https://github.com/bazelbuild/bazel/issues/4327
files = files.filter(f => !f.match(/[^\x21-\x7E]/));
files = files.filter(f => !f.test(/[^\x21-\x7E]/));
if (allowedExts.length) {
const allowNoExts = allowedExts.includes('');
files = files.filter(f => {
Expand Down

0 comments on commit 399c42c

Please sign in to comment.