mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
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.
This commit is contained in:
parent
dc788711c7
commit
5ff0ed3f99
1 changed files with 1 additions and 5 deletions
|
|
@ -293,11 +293,7 @@ impl VfsInner {
|
||||||
if let Some(&is_file) = cache.is_file.get(path) {
|
if let Some(&is_file) = cache.is_file.get(path) {
|
||||||
return Ok(Metadata { is_file });
|
return Ok(Metadata { is_file });
|
||||||
}
|
}
|
||||||
if cache
|
if cache.walked_roots.iter().any(|root| path.starts_with(root)) {
|
||||||
.walked_roots
|
|
||||||
.iter()
|
|
||||||
.any(|root| path.starts_with(root))
|
|
||||||
{
|
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
io::ErrorKind::NotFound,
|
io::ErrorKind::NotFound,
|
||||||
"not in prefetch cache",
|
"not in prefetch cache",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue