Unnamed repository; edit this file 'description' to name the repository.
internal: Split absolute path collection from reading files
This is not a logical change, and just makes the next commit simpler.
It also shouldn't impact performance, because the vast majority of
events have a single path.
| -rw-r--r-- | crates/vfs-notify/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index 428b19c50b..f91d830ca0 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs @@ -198,7 +198,7 @@ impl NotifyActor { && let EventKind::Create(_) | EventKind::Modify(_) | EventKind::Remove(_) = event.kind { - let files = event + let abs_paths: Vec<AbsPathBuf> = event .paths .into_iter() .filter_map(|path| { @@ -207,6 +207,10 @@ impl NotifyActor { .expect("path is absolute"), ) }) + .collect(); + + let files = abs_paths + .into_iter() .filter_map(|path| -> Option<(AbsPathBuf, Option<Vec<u8>>)> { // Ignore events for files/directories that we're not watching. if !(self.watched_file_entries.contains(&path) |