From 6681f9fcfd520c67af6ac719647e4c0b36b6f7f8 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 18 Feb 2019 13:45:35 +0100 Subject: Remove unused code Because the store is more efficient when reading and writing entries to disk, we do not need to flush the cache anymore. Hence, remove the flushing. Signed-off-by: Matthias Beyer --- bin/core/imag-diagnostics/src/main.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/bin/core/imag-diagnostics/src/main.rs b/bin/core/imag-diagnostics/src/main.rs index 4e978d55..4414c1b8 100644 --- a/bin/core/imag-diagnostics/src/main.rs +++ b/bin/core/imag-diagnostics/src/main.rs @@ -126,7 +126,6 @@ fn main() { "Print diagnostics about imag and the imag store", ui::build_ui); - let mut entries_counter = 0; let template = get_config(&rt, "rt.progressbar_style"); let tick_chars = get_config(&rt, "rt.progressticker_chars"); @@ -154,18 +153,6 @@ fn main() { let diag = Diagnostic::for_entry(&e); debug!("Diagnostic for '{:?}' = {:?}", e.get_location(), diag); drop(e); - - entries_counter += 1; - - // because we're effectively reading _all_ store entries here. - // - // The store has an API for it, but the cache size calculation is O(n) and we can do - // better by simply flushing the cache each 100 entries - if entries_counter > 100 { - let _ = rt.store().flush_cache().map_err_trace_exit_unwrap(); - entries_counter = 0; - } - diag }) .collect::>>() -- cgit v1.2.3