Skip to content

Commit

Permalink
Use Set.prototype.has over Array.prototype.includes
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl authored Mar 18, 2022
1 parent 34f44b4 commit 6598377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ micromatch.not = (list, patterns, options = {}) => {
items.push(state.output);
};

let matches = micromatch(list, patterns, { ...options, onResult });
let matches = new Set(micromatch(list, patterns, { ...options, onResult }));

for (let item of items) {
if (!matches.includes(item)) {
if (!matches.has(item)) {
result.add(item);
}
}
Expand Down

0 comments on commit 6598377

Please sign in to comment.