Page MenuHomePhabricator

Implement delete function for the RadixTree
ClosedPublic

Authored by deadalnix on Jan 18 2019, 00:52.

Details

Reviewers
jasonbcox
Fabien
Group Reviewers
Restricted Project
Commits
rABCbc165fe64bb0: Implement delete function for the RadixTree
Summary

It is failry similar to an insert operation, except it never generates a subtree.

Return false if the key is not found in the tree, true if it is.

Test Plan

Added test cases.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Jan 18 2019, 00:52
Herald added a reviewer: Restricted Project. · View Herald TranscriptJan 18 2019, 00:52
Herald added a subscriber: schancel. · View Herald Transcript
jasonbcox requested changes to this revision.Jan 18 2019, 01:09
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/test/radix_tests.cpp
233 ↗(On Diff #6719)

Needs a for loop that provides a set of cases where some random values, including min/max values, are inserted and deleted in random order.

Additionally, the inserts and deletes should be logged logged so that in the event of a failure, debugging will be possible.

This revision now requires changes to proceed.Jan 18 2019, 01:09
deadalnix updated this revision to Diff 6745.Jan 19 2019, 15:04

Add remove operation to the stress test

deadalnix updated this revision to Diff 6802.Jan 22 2019, 01:10

Add a synchronize after removing the element from the tree. As it turns out, we may delete the element we just inserted and have to ensure all other threads are past it for correctness. Not a hue deal because this code is going away anyways, but worth fixing for correctness.

deadalnix updated this revision to Diff 6851.Jan 23 2019, 00:12

Use the NULLPTR trick to make boost happy

Fabien accepted this revision.Jan 23 2019, 09:16
jasonbcox accepted this revision.Jan 24 2019, 00:39
This revision is now accepted and ready to land.Jan 24 2019, 00:39
This revision was automatically updated to reflect the committed changes.