Init function for the transfer region cache

This commit is contained in:
Emilia Allison 2025-01-02 21:21:34 -05:00
parent 8bf11eecca
commit b34b02af89
Signed by: emilia
GPG Key ID: 05D5D1107E5100A1
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,12 @@ impl TransferRegionCache {
} }
} }
pub fn generate_cache(&self, trs: &[Transfer]) {
for tr in trs.iter() {
self.add_overwrite(tr);
}
}
pub fn invalidate(&self, tr: &Transfer) { pub fn invalidate(&self, tr: &Transfer) {
if let Ok(mut interior) = self.interior.lock() { if let Ok(mut interior) = self.interior.lock() {
interior.cache.remove(&tr.id); interior.cache.remove(&tr.id);