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

Fix RHT.Remove and Add test code #752

Merged
merged 11 commits into from Jan 9, 2024
Merged

Fix RHT.Remove and Add test code #752

merged 11 commits into from Jan 9, 2024

Conversation

justiceHui
Copy link
Member

@justiceHui justiceHui commented Jan 8, 2024

What this PR does / why we need it:

  • Fixed nil pointer dereference error in RHT.Remove.
  • Fixed RHT.Len to exclude the removed elements.
  • Fixed RHT.Nodes to exclude the removed elements.
  • Fixed an error in RHT.Set when modifying an already deleted key.

Related to #748

Which issue(s) this PR fixes:

Fixes #

Checklist:

  • Added relevant tests or not required
  • Didn't break anything

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (6936d2b) 49.30% compared to head (b12d3d2) 49.48%.

Files Patch % Lines
pkg/document/crdt/rht.go 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #752      +/-   ##
==========================================
+ Coverage   49.30%   49.48%   +0.17%     
==========================================
  Files          69       69              
  Lines       10094    10099       +5     
==========================================
+ Hits         4977     4997      +20     
+ Misses       4601     4587      -14     
+ Partials      516      515       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@justiceHui justiceHui changed the base branch from main to tree-remove-style January 8, 2024 06:59
@justiceHui justiceHui changed the base branch from tree-remove-style to main January 8, 2024 07:11
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.
Overall looks good. I left a simple question.

pkg/document/crdt/rht.go Outdated Show resolved Hide resolved
pkg/document/crdt/rht.go Outdated Show resolved Hide resolved
@hackerwins hackerwins self-requested a review January 8, 2024 10:18
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

pkg/document/crdt/rht.go Outdated Show resolved Hide resolved
@hackerwins hackerwins merged commit 3876b8f into main Jan 9, 2024
3 checks passed
@hackerwins hackerwins deleted the rht-remove-patch branch January 9, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants