Simplify code.

This commit is contained in:
Stephen Chung
2023-02-28 22:33:44 +08:00
parent 9a5221f60d
commit 86ccb37029
10 changed files with 28 additions and 78 deletions

View File

@@ -239,14 +239,7 @@ impl FileModuleResolver {
if !self.cache_enabled {
return false;
}
let cache = locked_read(&self.cache);
if cache.is_empty() {
false
} else {
cache.contains_key(path.as_ref())
}
locked_read(&self.cache).contains_key(path.as_ref())
}
/// Empty the internal cache.
#[inline]