Do not cache "one-hit wonders"
This commit is contained in:
@@ -234,7 +234,7 @@ impl Engine {
|
||||
) -> bool {
|
||||
let cache = caches.fn_resolution_cache_mut();
|
||||
|
||||
if let Some(result) = cache.get(&hash_script).map(Option::is_some) {
|
||||
if let Some(result) = cache.map.get(&hash_script).map(Option::is_some) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,11 @@ impl Engine {
|
||||
|| self.global_sub_modules.values().any(|m| m.contains_qualified_fn(hash_script));
|
||||
|
||||
if !result {
|
||||
cache.insert(hash_script, None);
|
||||
if cache.filter.is_absent(hash_script) {
|
||||
cache.filter.mark(hash_script);
|
||||
} else {
|
||||
cache.map.insert(hash_script, None);
|
||||
}
|
||||
}
|
||||
|
||||
result
|
||||
|
Reference in New Issue
Block a user