Skip to content

Commit db3a690

Browse files
committed
address joshua & phoebe's reviews
1 parent 9d91846 commit db3a690

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

crates/core/src/subscription/subscription.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ pub struct IncrementalJoin {
209209

210210
/// One side of an [`IncrementalJoin`].
211211
///
212-
/// Holds the "physical" [`DbTable`] this side of the join operates on, as well
213-
/// as the updates pertaining to that table.
212+
/// Holds the updates pertaining to a table on one side of the join.
214213
struct JoinSide {
215214
inserts: Vec<ProductValue>,
216215
deletes: Vec<ProductValue>,
@@ -337,14 +336,19 @@ impl IncrementalJoin {
337336
let mut rhs_inserts = Vec::new();
338337
let mut rhs_deletes = Vec::new();
339338

340-
// Partitions deletes of `update` into `ds` and inserts into `is`.
341-
let partition_into = |ds: &mut Vec<_>, is: &mut Vec<_>, updates: &DatabaseTableUpdate| {
339+
// Partitions `updates` into `deletes` and `inserts`.
340+
let partition_into = |deletes: &mut Vec<_>, inserts: &mut Vec<_>, updates: &DatabaseTableUpdate| {
342341
for update in &updates.ops {
343-
if update.op_type == 0 { &mut *ds } else { &mut *is }.push(update.row.clone());
342+
if update.op_type == 0 {
343+
&mut *deletes
344+
} else {
345+
&mut *inserts
346+
}
347+
.push(update.row.clone());
344348
}
345349
};
346350

347-
// Partitions all updates into the `l/rhs_insert/delete_ops` above.
351+
// Partitions all updates into the `(l|r)hs_(insert|delete)_ops` above.
348352
for update in updates {
349353
if update.table_id == self.lhs.table_id {
350354
partition_into(&mut lhs_deletes, &mut lhs_inserts, update);

0 commit comments

Comments
 (0)