rename: sort candidates by least-recently visited
Instead of a hard 7-day cutoff, sort rename candidates so the least-recently visited come first. Naturally prioritizes unseen nodes while allowing revisits once everything's been through.
This commit is contained in:
parent
11cbd9664a
commit
9fef98b01e
1 changed files with 2 additions and 1 deletions
|
|
@ -275,7 +275,8 @@ pub fn format_rename_candidates(store: &Store, count: usize) -> (Vec<String>, St
|
|||
.map(|(k, n)| (k.as_str(), n))
|
||||
.collect();
|
||||
|
||||
candidates.sort_by(|a, b| b.1.timestamp.cmp(&a.1.timestamp));
|
||||
// Least-recently visited first — naturally prioritizes unseen nodes
|
||||
candidates.sort_by_key(|(key, _)| store.last_visited(key, "rename"));
|
||||
candidates.truncate(count);
|
||||
|
||||
let keys: Vec<String> = candidates.iter().map(|(k, _)| k.to_string()).collect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue