Skip to content

Commit

Permalink
Renamed some identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
josephg committed Jul 12, 2024
1 parent ce9e88f commit a380287
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/listmerge/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::list::ListOpLog;
use crate::list::op_iter::OpMetricsIter;
use crate::list::op_metrics::{ListOperationCtx, ListOpMetrics};
use crate::list::operation::{ListOpKind, TextOperation};
use crate::listmerge::{DocRangeIndex, M2Tracker, NewIndex, OldIndex};
use crate::listmerge::{DocRangeIndex, M2Tracker, Index, OldIndex};
#[cfg(feature = "dot_export")]
use crate::listmerge::dot::DotColor::*;
use crate::listmerge::markers::{DelRange, Marker};
Expand All @@ -43,7 +43,7 @@ const ALLOW_FF: bool = true;
#[cfg(feature = "dot_export")]
const MAKE_GRAPHS: bool = false;

pub(super) fn notify_for<'a>(index: &'a mut NewIndex) -> impl FnMut(CRDTSpan, LeafIdx) + 'a {
pub(super) fn notify_for<'a>(index: &'a mut Index) -> impl FnMut(CRDTSpan, LeafIdx) + 'a {
move |entry: CRDTSpan, leaf| {
debug_assert!(leaf.exists());

Expand Down Expand Up @@ -117,7 +117,7 @@ impl M2Tracker {
}
}

fn get_new_cursor_before(&self, lv: LV) -> ContentCursor {
fn get_cursor_before(&self, lv: LV) -> ContentCursor {
if lv == usize::MAX {
// This case doesn't seem to ever get hit by the fuzzer. It might be equally correct to
// just panic() here.
Expand Down Expand Up @@ -234,8 +234,8 @@ impl M2Tracker {
else { scanning = false; }
} else {
// Set scanning based on how the origin_right entries are ordered.
let my_right_cursor = self.get_new_cursor_before(item.origin_right);
let other_right_cursor = self.get_new_cursor_before(other_entry.origin_right);
let my_right_cursor = self.get_cursor_before(item.origin_right);
let other_right_cursor = self.get_cursor_before(other_entry.origin_right);

if other_right_cursor.cmp(&my_right_cursor, &self.range_tree) == Ordering::Less {
if !scanning {
Expand Down
6 changes: 2 additions & 4 deletions src/listmerge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub(crate) mod plan;
pub(crate) mod xf_old;

type DocRangeIndex = MarkerMetrics;
type CRDTList2 = Pin<Box<ContentTreeRaw<CRDTSpan, DocRangeIndex>>>;

// type SpaceIndex = Pin<Box<ContentTreeRaw<MarkerEntry, RawPositionMetricsUsize>>>;
// type SpaceIndexCursor = UnsafeCursor<MarkerEntry, RawPositionMetricsUsize>;
Expand All @@ -56,8 +55,7 @@ type CRDTList2 = Pin<Box<ContentTreeRaw<CRDTSpan, DocRangeIndex>>>;

// RecordingTree is necessary if gen_test_data is enabled.
// type Index = RecordingTree<Marker>;
type OldIndex = IndexTree<Marker>;
type NewIndex = IndexTree<Marker>;
type Index = IndexTree<Marker>;

#[derive(Debug)]
struct M2Tracker {
Expand All @@ -68,7 +66,7 @@ struct M2Tracker {
///
/// - For inserts, this contains a pointer to the node in range_tree which contains this version
/// - For deletes, this names the time at which the delete happened.
index: NewIndex,
index: Index,

range_tree: ContentTree<CRDTSpan>,

Expand Down

0 comments on commit a380287

Please sign in to comment.