From 23931f8a4f1de0964de3eef8d1c285deb6d0d39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Sun, 5 Mar 2023 19:50:01 +0100 Subject: [PATCH] Fix small bug in visual logger of search algo --- milli/src/search/new/logger/detailed.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/milli/src/search/new/logger/detailed.rs b/milli/src/search/new/logger/detailed.rs index d2ce627dc..a9f4ee045 100644 --- a/milli/src/search/new/logger/detailed.rs +++ b/milli/src/search/new/logger/detailed.rs @@ -282,7 +282,9 @@ results.{random} {{ }, SearchEvents::WordsState { query_graph } => { let cur_ranking_rule = timestamp.len() - 1; + *timestamp.last_mut().unwrap() += 1; let cur_activated_id = activated_id(×tamp); + *timestamp.last_mut().unwrap() -= 1; let id = format!("{cur_ranking_rule}.{cur_activated_id}"); let new_file_path = self.folder_path.join(format!("{id}.d2")); let mut new_file = std::fs::File::create(new_file_path).unwrap(); @@ -295,7 +297,9 @@ results.{random} {{ }, SearchEvents::ProximityState { graph, paths, empty_paths_cache, universe, distances, cost } => { let cur_ranking_rule = timestamp.len() - 1; + *timestamp.last_mut().unwrap() += 1; let cur_activated_id = activated_id(×tamp); + *timestamp.last_mut().unwrap() -= 1; let id = format!("{cur_ranking_rule}.{cur_activated_id}"); let new_file_path = self.folder_path.join(format!("{id}.d2")); let mut new_file = std::fs::File::create(new_file_path).unwrap(); @@ -309,7 +313,9 @@ results.{random} {{ }, SearchEvents::TypoState { graph, paths, empty_paths_cache, universe, distances, cost } => { let cur_ranking_rule = timestamp.len() - 1; + *timestamp.last_mut().unwrap() += 1; let cur_activated_id = activated_id(×tamp); + *timestamp.last_mut().unwrap() -= 1; let id = format!("{cur_ranking_rule}.{cur_activated_id}"); let new_file_path = self.folder_path.join(format!("{id}.d2")); let mut new_file = std::fs::File::create(new_file_path).unwrap();