Skip to content

Commit 25393b4

Browse files
committed
antijoin bug
1 parent 53d76f2 commit 25393b4

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/bin/borrow_check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fn main() {
2020
let subset_r2p = iteration1.variable::<((Region, Point), Region)>("subset_r2p");
2121
let subset_p = iteration1.variable::<(Point, (Region, Region))>("subset_p");
2222

23+
// temporaries as we perform a multi-way join.
2324
let subset_1 = iteration1.variable::<((Region, Point), Region)>("subset_1");
2425
let subset_2 = iteration1.variable::<((Region, Point), Region)>("subset_2");
2526

src/join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn antijoin_into<Key: Ord, Val: Ord, Result: Ord, F: Fn(&Key, &Val)->Result>
4242

4343
for &(ref key, ref val) in input1.recent.borrow().iter() {
4444
tuples2 = gallop(tuples2, |k| k < key);
45-
if tuples2.first() == Some(key) {
45+
if tuples2.first() != Some(key) {
4646
results.push(logic(key, val));
4747
}
4848
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ pub struct Variable<Tuple: Ord> {
118118
pub to_add: Rc<RefCell<Vec<Relation<Tuple>>>>,
119119
}
120120

121+
// Operator implementations.
121122
impl<Tuple: Ord> Variable<Tuple> {
122123
/// Adds tuples that result from joining `input1` and `input2`.
123124
pub fn from_join<K: Ord,V1: Ord, V2: Ord, F: Fn(&K,&V1,&V2)->Tuple>(

0 commit comments

Comments
 (0)