Introduce a new fingerprint
field to TextSummary
This is calculated in `Rope` and uses the `bromberg_sl2` homomorphic hash function to determine the fingerprint of a single chunk and compose each chunk fingerprint into a single fingerprint for the entire rope that is equivalent to hashing all the rope's bytes at once.
This commit is contained in:
parent
cef85f5d84
commit
c31a233aad
6 changed files with 33 additions and 22 deletions
|
@ -1923,15 +1923,7 @@ impl MultiBufferSnapshot {
|
|||
);
|
||||
|
||||
if range.end > end_before_newline {
|
||||
summary.add_assign(&D::from_text_summary(&TextSummary {
|
||||
bytes: 1,
|
||||
lines: Point::new(1 as u32, 0),
|
||||
lines_utf16: PointUtf16::new(1 as u32, 0),
|
||||
first_line_chars: 0,
|
||||
last_line_chars: 0,
|
||||
longest_row: 0,
|
||||
longest_row_chars: 0,
|
||||
}));
|
||||
summary.add_assign(&D::from_text_summary(&TextSummary::from("\n")));
|
||||
}
|
||||
|
||||
cursor.next(&());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue