From b34b02af89ce247ed072d2555dd60ead011c1a28 Mon Sep 17 00:00:00 2001 From: Emilia Date: Thu, 2 Jan 2025 21:21:34 -0500 Subject: [PATCH] Init function for the transfer region cache --- plate-tool-lib/src/transfer_region_cache.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plate-tool-lib/src/transfer_region_cache.rs b/plate-tool-lib/src/transfer_region_cache.rs index bb453a3..db20014 100644 --- a/plate-tool-lib/src/transfer_region_cache.rs +++ b/plate-tool-lib/src/transfer_region_cache.rs @@ -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) { if let Ok(mut interior) = self.interior.lock() { interior.cache.remove(&tr.id);