diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/changes.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/api/changes.rs b/src/api/changes.rs index 1dd1f91..ee6a74a 100644 --- a/src/api/changes.rs +++ b/src/api/changes.rs @@ -17,8 +17,8 @@ use crate::state::AppState; /// Changes listed at most. const MAX_LIMIT: usize = 1000; -/// Changes looked at at most, newest first, for those touching `path`: each costs a -/// diff, under the document's read lock. +/// Changes looked at at most, newest first, for those touching `path`: each costs +/// decoding it, under the document's read lock (`store::changed_by`). const MAX_SCANNED: usize = 10_000; #[derive(Debug, Deserialize)] @@ -107,14 +107,8 @@ fn changes( break; } scanned += 1; - // What this change did: its history without it, to its history with it. - let mut paths: Vec<Vec<String>> = - store::changed(doc, &meta.deps, &[meta.hash], InLists::Index) - .into_iter() - .map(|changed| changed.path) - .collect(); - paths.sort(); - paths.dedup(); + // What this change did, from its operations. + let paths = store::changed_by(doc, &meta.hash, InLists::Index).unwrap_or_default(); if let Some(path) = path && !paths .iter() |
