-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query method is immutable reference #17
Conversation
You were right @marcus-pousette, we got another small perf improvement 👍 |
@marcus-pousette, I had to revert the changes I made to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, that might be worth considering.
but the main problem as that I think the count_documents
fn has to respect removed
set
Good find and solution regarding the Filter
I thought about this when reviewing your last PR but I thought there would be a explicit lifetime trick you could do in order to circumvent this, but I realize now it is not possible yet to associate lifetimes with borrows in a fn
.
let mut term_counts: HashMap<String, Vec<usize>> = HashMap::new(); | ||
let mut all_terms: Vec<String> = Vec::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut term_counts: HashMap<String, Vec<usize>> = HashMap::new(); | |
let mut all_terms: Vec<String> = Vec::new(); | |
let mut term_counts: HashMap<Cow<str>, Vec<usize>> = HashMap::new(); | |
let mut all_terms: Vec<Cow<str>> = Vec::new(); |
In Index::add_document().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good now. Have you done all the changes you wanted to do? @tmpfs
Sure @marcus-pousette, I think this is good enough for this PR, ping me when you push your |
Closes #16.