-
Notifications
You must be signed in to change notification settings - Fork 112
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
chore(lib/trie): refactor lib/trie/database.go
#2108
Conversation
Codecov Report
@@ Coverage Diff @@
## development #2108 +/- ##
===============================================
+ Coverage 61.37% 61.51% +0.13%
===============================================
Files 202 213 +11
Lines 27362 27429 +67
===============================================
+ Hits 16794 16873 +79
+ Misses 8692 8688 -4
+ Partials 1876 1868 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4be7986
to
93ee8b6
Compare
07e4d7c
to
dbc59e5
Compare
dbc59e5
to
ea0cee4
Compare
288b369
to
d310edf
Compare
- Explicit variable names - Less indentation - More return early - Add named returns - Clarify comments - Wrap errors
Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com>
d310edf
to
f5c72bc
Compare
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 like that we are checking !ok
instead of ok
Looks good, only small comments!
Where do you mean this? 🤔 |
Sometimes, we check for the expected condition (true) and run when true and don't do anything when false. I think you would have checked for the unexpected condition first and run some code on that unexpected condition. |
@kishansagathiya I tend to have the smaller code part inside the if block checking |
Changes
This is a simple 'linear' refactor in order to see diffs in a clearer way.
Tests
Issues
Primary Reviewer