GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: improve globSync performance · nodejs/node@3edea66

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/fs
    • glob.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/fs/glob.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/glob.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,7 @@ class Glob {
331331
const fullpath = resolve(this.#root, path);
332332

333333
// If path is a directory, add trailing slash and test patterns again.
334-
// TODO(Trott): Would running #isExcluded() first and checking isDirectory() only
335-
// if it matches be more performant in the typical use case? #isExcluded()
336-
// is often ()=>false which is about as optimizable as a function gets.
337-
if (this.#cache.statSync(fullpath).isDirectory() && this.#isExcluded(`${fullpath}/`)) {
334+
if (this.#isExcluded(`${fullpath}/`) && this.#cache.statSync(fullpath).isDirectory()) {
338335
return;
339336
}
340337

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.