fix(memory_tree): code quality improvements on batch tree fetch (PR #2976 follow-up) (#3020)

Co-authored-by: Maciej Myszkiewicz <mmyszkiewicz@bwcoders.com>
Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
Co-authored-by: Taimoor <astikkosapparel009@gmail.com>
This commit is contained in:
Shaikh Taimoor
2026-05-30 10:14:28 -07:00
committed by GitHub
co-authored by Maciej Myszkiewicz Steven Enamakel Taimoor
parent 597290822a
commit d08882b219
+3
View File
@@ -47,6 +47,9 @@ pub async fn flush_stale_buffers(
// Missing rows stay silently absent from the map; the
// `Some(t) => ... / None => warn-and-skip` orphan-buffer path below
// preserves the per-id `get_tree` `Ok(None)` semantics.
// Preserve list_stale_buffers order so the HashMap lookup below stays
// predictable; dedup is purely to avoid redundant DB params (not for
// semantic ordering — the per-buffer loop walks `stale` directly).
let distinct_tree_ids: Vec<String> = {
let mut seen = std::collections::HashSet::new();
let mut out = Vec::new();