Bump the sdset dependency to 0.3.6

This commit is contained in:
Clément Renault 2019-12-11 12:08:30 +01:00
parent 8d71112dcb
commit efc2be0b7b
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
3 changed files with 10 additions and 18 deletions

View file

@ -121,7 +121,6 @@ pub fn bucket_sort<'c>(
let postings_list = &arena[sm.postings_list];
let input = postings_list.input();
let query = &automatons[sm.query_index as usize].query;
debug!("{:?} contains {:?}", d.raw_matches[0].document_id, query);
postings_list.iter().map(move |m| {
let covered_area = if query.len() > input.len() {
input.len()
@ -132,8 +131,6 @@ pub fn bucket_sort<'c>(
})
}).collect();
debug!("{:?} contains {:?}", d.raw_matches[0].document_id, d.processed_distances);
Document {
id: d.raw_matches[0].document_id,
highlights,
@ -170,13 +167,13 @@ impl<'a, 'tag> RawDocument<'a, 'tag> {
let b = match raw_matches.get(i + 1) {
Some(b) => b,
None => {
postings_lists[a.postings_list].rewrite_with(SetBuf::new_unchecked(Vec::new()));
postings_lists[a.postings_list].rewrite_with(SetBuf::default());
continue;
}
};
if a.query_index + 1 != b.query_index {
postings_lists[a.postings_list].rewrite_with(SetBuf::new_unchecked(Vec::new()));
postings_lists[a.postings_list].rewrite_with(SetBuf::default());
continue
}
@ -197,21 +194,16 @@ impl<'a, 'tag> RawDocument<'a, 'tag> {
}
}
if !newa.is_empty() {
previous_word = Some(a.query_index);
postings_lists[a.postings_list].rewrite_with(SetBuf::new_unchecked(newa));
postings_lists[b.postings_list].rewrite_with(SetBuf::new_unchecked(newb));
} else {
// TODO use SetBuf::default when merged
postings_lists[a.postings_list].rewrite_with(SetBuf::new_unchecked(Vec::new()));
postings_lists[b.postings_list].rewrite_with(SetBuf::new_unchecked(Vec::new()));
}
postings_lists[a.postings_list].rewrite_with(SetBuf::new_unchecked(newa));
postings_lists[b.postings_list].rewrite_with(SetBuf::new_unchecked(newb));
},
Some((1, _)) => {
if previous_word.take() != Some(a.query_index - 1) {
postings_lists[a.postings_list].rewrite_with(SetBuf::new_unchecked(Vec::new()));
postings_lists[a.postings_list].rewrite_with(SetBuf::default());
}
},
Some((_, _)) => unreachable!(),