-
Notifications
You must be signed in to change notification settings - Fork 274
refactor: use the built-in max/min to simplify the code #1777
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
WalkthroughThe changes update the implementation of the Changes
Sequence Diagram(s)sequenceDiagram
participant UHS as updateHeightSize
participant LN as Left Child Node
participant RN as Right Child Node
participant M as max Function
UHS->>LN: Retrieve left child height
UHS->>RN: Retrieve right child height
UHS->>M: Call max(left, right)
M-->>UHS: Return maximum height
UHS->>UHS: Update node height and size
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (17)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thanks for your review! |
|
@pkucode can you help to sign the commit? |
Signed-off-by: pkucode <[email protected]>
Of course. Signed. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1777 +/- ##
===========================================
+ Coverage 16.87% 35.54% +18.66%
===========================================
Files 72 127 +55
Lines 6163 11961 +5798
===========================================
+ Hits 1040 4251 +3211
- Misses 5000 7282 +2282
- Partials 123 428 +305
🚀 New features to boost your workflow:
|
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make)make test)go fmt)golangci-lint run)go list -json -m all | nancy sleuth)Use the built-in max/min from the standard library in Go 1.21 to simplify the code. https://pkg.go.dev/[email protected]#max
Summary by CodeRabbit