refactor: remove redundant multi-line search index unwrap clones across all handlers via new get_search_index accessor

This commit is contained in:
Riz Ashraf committed 2026-09-26 08:39:42 +01:00
1 parent d96b4cf822
commit 0ba0ed5b3d
5 files changed
+12 -36

No files matched your search

+4
View File
@@ -123,6 +123,10 @@ impl MemoryState {
self.graph.modify(update_fn);
}
pub fn get_search_index(&self) -> MemoryIndex {
self.search_index.read().unwrap_or_else(|e| e.into_inner()).clone()
}
pub async fn rebuild_index(self: &Arc<Self>) {
if let Ok(new_idx) = MemoryIndex::new(&self.base_dir) {
let idx = new_idx.clone();