fix: don't evict cache entries with no artifacts (#1035)
This commit is contained in:
parent
72e280d2cc
commit
fac944be00
|
@ -294,6 +294,12 @@ impl SolFilesCache {
|
||||||
let mut files: HashMap<_, _> = files.into_iter().map(|(p, v)| (p, v)).collect();
|
let mut files: HashMap<_, _> = files.into_iter().map(|(p, v)| (p, v)).collect();
|
||||||
|
|
||||||
self.files.retain(|file, entry| {
|
self.files.retain(|file, entry| {
|
||||||
|
if entry.artifacts.is_empty() {
|
||||||
|
// keep entries that didn't emit any artifacts in the first place, such as a
|
||||||
|
// solidity file that only includes error definitions
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(versions) = files.remove(file.as_path()) {
|
if let Some(versions) = files.remove(file.as_path()) {
|
||||||
entry.retain_versions(versions);
|
entry.retain_versions(versions);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue