Merged
Conversation
We have three places which are doing the same thing, concentrate the bit of logic into CNode.renew(). Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
We have two places which are doing the same thing for insert(). Since we have one alternative already existing, this moves the second piece from MutableTrieMap to CNode. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Part one of splitting this method up again: move it to INode. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
This breaks out CNode.lookup() with appropriate arguments to recurse into INodes. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
The two methods are cooperating, split them out from MutableTrieMap, leading to a significant simplification of code. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
The two methods are cooperating, which is obvious in MutableTrieMap.recInsert() progress. Split that method up again, leading to simpler code at each level. It also allows us to reshuffle method placement and visibility a bit. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
We have a few improvements that we can make: - rename insertifhc() to insertIf() and move it below replace() - rename removehc() to removeIf() and move it below insertIf() - inline add() into SerializationProxy - compute hc in insertIf()/removeIf() Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Rather than passing as the last argument, always pass it as the first, making for more navigable code. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Capture the type dispatch in CNode.elementSize() into a Branch.elementSize(), which is then implemented by the two types. As a consequence, the type safety of MainNode.size() is improved as well. Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This refactors out TrieMap.recLookup() and all MutableTrieMap mutators
so they descend the tree hierarchy via CNode/INode recursion, ending our
refactoring efforts.
The end delta since triemap-1.3.2 ends up being the break up of INode.rec*
methods driven by us choosing a different strategy enabled by
INode.gcasWrite() being exposed to the outside world -- thus any of
CNode/INode/LNode can use it as needed.