Skip to content

Commit

Permalink
refactor(crdt): remove unnecessary tombstone removal logic
Browse files Browse the repository at this point in the history
Remove unused 'value' variable and logic for removing tombstones
in the change processing loop, simplifying the code structure.
  • Loading branch information
sinkingsugar committed Oct 10, 2024
1 parent 4046d65 commit a43ebc3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions crdt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@ class CRDT : public std::enable_shared_from_this<CRDT<K, V, MergeRuleType, Chang
for (const auto &change : changes) {
const K &record_id = change.record_id;
const std::optional<CrdtString> &col_name = change.col_name;
const std::optional<V> &value = change.value;

if (!col_name.has_value()) {
// The change was a record deletion (tombstone)
Expand All @@ -878,10 +877,6 @@ class CRDT : public std::enable_shared_from_this<CRDT<K, V, MergeRuleType, Chang
record_ptr->column_versions.at(ref_col).db_version, node_id_,
record_ptr->column_versions.at(ref_col).local_db_version));
}
// Remove the tombstone
inverse_changes.emplace_back(Change<K, V>(record_id, std::nullopt, std::nullopt,
0, // Column version 0 signifies removal of tombstone
clock_.current_time(), node_id_));
}
} else {
// The change was an insertion or update of a column
Expand Down

0 comments on commit a43ebc3

Please sign in to comment.