Skip to content

Commit

Permalink
refactor(crdt): improve ChangeComparator equality check
Browse files Browse the repository at this point in the history
Update ChangeComparator to explicitly handle node_id equality case
  • Loading branch information
sinkingsugar committed Oct 1, 2024
1 parent e59f9ac commit 2fbe25c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crdt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ template <typename K, typename V> struct ChangeComparator {
return a.col_version > b.col_version;
if (a.db_version != b.db_version)
return a.db_version > b.db_version;
return a.node_id > b.node_id;
// Add this line:
if (a.node_id != b.node_id)
return a.node_id > b.node_id;
return false; // Consider equal if all fields match
}
};
Expand Down

0 comments on commit 2fbe25c

Please sign in to comment.