September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -12,13 +12,15 @@ fn main() {
// hash phase
let mut h = HashMap::new();
for (i, a) in table_a.iter().enumerate() {
h.entry(a.1).or_insert(vec![]).push(i);
h.entry(a.1).or_insert_with(Vec::new).push(i);
}
// join phase
for b in table_b {
for i in h.get(b.0).unwrap_or(&vec![]) {
let a = table_a.get(*i).unwrap();
println!("{:?} {:?}", a, b);
if let Some(vals) = h.get(b.0) {
for &val in vals {
let a = table_a.get(val).unwrap();
println!("{:?} {:?}", a, b);
}
}
}
}