-
Notifications
You must be signed in to change notification settings - Fork 51
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
refactor rust part #30
Conversation
data | ||
} | ||
|
||
pub(crate) fn update_multi_tasks(&self, code: TaskCode, ids: &[u32], data: &[Bytes]) { |
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.
This function should be able to remove the timeout ids to increase the efficiency. Not sure if it's necessary to do here.
let mut data: Vec<Bytes> = Vec::with_capacity(ids.len()); | ||
let table = self.table.read(); | ||
// delete the task_id if the task_id doesn't exist in the table | ||
ids.retain(|&id| match table.get(&id) { |
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.
Not sure if retain
can get a slight better performance.
close #26
close #20
close #21
close #22