Skip to content
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

Trie improvements #789

Merged
merged 4 commits into from Mar 22, 2019

Conversation

Projects
None yet
6 participants
@lsebrie
Copy link
Contributor

commented Mar 21, 2019

No description provided.

@lsebrie lsebrie requested a review from diega Mar 21, 2019

@lsebrie lsebrie force-pushed the trie_improvements branch from 3322247 to 091611c Mar 21, 2019

@rskops

This comment has been minimized.

Copy link

commented Mar 21, 2019

SonarQube analysis reported 9 issues

  1. MAJOR Trie.java#L134: The Cyclomatic Complexity of this method "fromMessage" is 11 which is greater than 10 authorized. rule
  2. MAJOR Trie.java#L450: Return an empty array instead of null. rule
  3. MAJOR Trie.java#L455: Return an empty array instead of null. rule
  4. MAJOR Trie.java#L464: Return an empty array instead of null. rule
  5. MAJOR Trie.java#L579: The Cyclomatic Complexity of this method "internalPut" is 11 which is greater than 10 authorized. rule
  6. MAJOR Trie.java#L713: Return an empty array instead of null. rule
  7. MINOR Trie.java#L56: Use already-defined constant 'PANIC_TOPIC' instead of duplicating its value here. rule
  8. MINOR Trie.java#L459: Return a copy of "value". rule
  9. INFO Trie.java#L680: Class co.rsk.trie.Trie 'overloads' a method with both instance and static versions rule
@tinchou
Copy link
Contributor

left a comment

Approving in place of @lsebrie. He created the PR for me and now he can't approve it.

@diega diega merged commit 7801b5d into master Mar 22, 2019

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
default Build finished.
Details
sonarqube SonarQube reported 9 issues, no criticals or blockers

@diega diega deleted the trie_improvements branch Mar 22, 2019

@@ -106,7 +106,7 @@ private Trie(TrieStore store, TrieKeySlice sharedPath, byte[] value, boolean isS

// full constructor
private Trie(TrieKeySlice sharedPath, byte[] value, NodeReference left, NodeReference right, TrieStore store, boolean isSecure) {
this.value = value;
this.value = cloneArray(value);

This comment has been minimized.

Copy link
@SergioDemianLerner

SergioDemianLerner Mar 22, 2019

Contributor

Maybe implement a private constructor that copies the reference (not the content) so that insertion/deletion operations keep being log2(N) and not dependent on the size of the value (e.g. a long bytecode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.