Skip to content
Myr

Merge pull request #1914 from tmccombs/faster-ignore-contains

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Thayne McCombs · committed by GitHub · parents b691572, a4d86cc · Browse files · 1 file+11 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • perf: Avoid unnecessary syscall for ignore-contain

Diff stats

1 file+11 added−5 removed

  • other:+11 added−5 removed

1 file+11 added−5 removed

modified:src/walk.rs+11 added-5 removed
460 unmodified lines
461 return WalkState::Quit;462 }463464 if let Ok(e) = &entry {465 let entry_path = e.path();466 if entry_path.is_dir()467 && config465 // If the entry is a directory that contains a466 // "ignore contain" file", we want to skip this467 // directory.468 // Check the filetype first to avoid unnecessary469 // syscalls.470 if e.file_type().is_some_and(|t| t.is_dir()) {471 let entry_path = e.path();472 if config473 .ignore_contain474 .iter()475 .any(|ic| entry_path.join(ic).exists())471 {472 return WalkState::Skip;476 {477 return WalkState::Skip;478 }479 }480 if e.depth() == 0 {481 // Skip the root directory entry.482 return WalkState::Continue;
204 unmodified lines