-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Merkle clock heads cleanup (#918)
* Remove commented out code * Remove dead code (Len) * Remove unnessecary var declaration * Remove unessecary func param * Remove extra Add func Add is a poor name, and adds an extra layer of misdirection. * Remove extra delete func Is only called from here, and the caller to this function knows that this row exists, so we will never actually hit the isNotFound error allowing it to be safely dropped. * Rename func params Old names unhelpful and the distinction was easily missed resulting in a bug (caught by tests). * Unfactor IsHead Is only called once, and the unfactoring allows for future refactorings * Remove unused return param * Use Has instead of Get+IsError * Remove private constructor * Remove incorrect error Error would have been way up the callstack where ever height was declared, and it is on those funcs to make sure it fits whatever constraints they may have. * Remove unhelpful comment Is also potentially misleading as the cid's location in the key is dependent on the index format, not the code in this file/package * Remove cid-based shortcut This optimization should be handled by the index, not the scan code. It also produces undesirable errors which have been corrected in this commit.
- Loading branch information
1 parent
3b53193
commit dbc8cd0
Showing
6 changed files
with
22 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.