-
Notifications
You must be signed in to change notification settings - Fork 526
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(state_table): simplify interface of insert / delete #3238
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3238 +/- ##
=======================================
Coverage 73.19% 73.19%
=======================================
Files 745 745
Lines 101868 101857 -11
=======================================
- Hits 74563 74556 -7
+ Misses 27305 27301 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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.
Looks good
match TOP_N_TYPE { | ||
TOP_N_MIN => self.state_table.insert::<false>(value.clone())?, | ||
TOP_N_MAX => self.state_table.insert::<true>(value.clone())?, | ||
TOP_N_MIN => self.state_table.insert(value.clone())?, | ||
TOP_N_MAX => self.state_table.insert(value.clone())?, | ||
_ => unreachable!(), |
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.
No need to match here? 😁
TOP_N_MIN => self.state_table.delete::<false>(value)?, | ||
TOP_N_MAX => self.state_table.delete::<true>(value)?, | ||
TOP_N_MIN => self.state_table.delete(value)?, | ||
TOP_N_MAX => self.state_table.delete(value)?, |
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.
Ditto.
What's changed and what's your intention?
As title
Checklist
./risedev check
(or alias,./risedev c
)Refer to a related PR or issue link (optional)
close #3232