-
-
Notifications
You must be signed in to change notification settings - Fork 41
Fix Swap function for lfu.priorityQueue. #40
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
Conversation
Fix #39 |
I found a workflow in |
func (q priorityQueue[K, V]) Swap(i, j int) { | ||
q[i], q[j] = q[j], q[i] | ||
q[i].index = i | ||
q[j].index = j |
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.
@chenyanchen Did you fix just this line?
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.
Yes
I approved to run actions in this PR for now |
Codecov Report
@@ Coverage Diff @@
## main #40 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 533 533
=========================================
Hits 533 533
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
What's wrong with |
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.
LGTM!
Thank you
Make the
entry
's index right.