Don't seek FilterCursor
upon creation
This lets us use `next` or `prev` to decide whether to park the cursor at the first or last filtered item. Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f10fd6c419
commit
a6d0caf557
5 changed files with 58 additions and 50 deletions
|
@ -1849,10 +1849,11 @@ impl BufferSnapshot {
|
|||
let fragments_cursor = if *since == self.version {
|
||||
None
|
||||
} else {
|
||||
Some(self.fragments.filter(
|
||||
move |summary| !since.observed_all(&summary.max_version),
|
||||
&None,
|
||||
))
|
||||
let mut cursor = self
|
||||
.fragments
|
||||
.filter(move |summary| !since.observed_all(&summary.max_version));
|
||||
cursor.next(&None);
|
||||
Some(cursor)
|
||||
};
|
||||
let mut cursor = self
|
||||
.fragments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue