From 5ff0ed3f99fcafed26536c52f93facae3c887c84 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 6 Mar 2026 20:55:28 -0600 Subject: [PATCH] Refactor cache lookup logic in VFS to streamline path checks - Simplified the condition for checking if a path is within the walked roots by removing unnecessary variable assignments. - This change enhances the clarity and efficiency of the metadata retrieval process in the VFS. --- crates/memofs/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/memofs/src/lib.rs b/crates/memofs/src/lib.rs index 0e71185f..62c72557 100644 --- a/crates/memofs/src/lib.rs +++ b/crates/memofs/src/lib.rs @@ -293,11 +293,7 @@ impl VfsInner { if let Some(&is_file) = cache.is_file.get(path) { return Ok(Metadata { is_file }); } - if cache - .walked_roots - .iter() - .any(|root| path.starts_with(root)) - { + if cache.walked_roots.iter().any(|root| path.starts_with(root)) { return Err(io::Error::new( io::ErrorKind::NotFound, "not in prefetch cache",