Page MenuHomePhabricator

Implement delete function for the RadixTree
ClosedPublic

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

Details

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
Branch
radixdelete
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4654
Build 7371: Bitcoin ABC Buildbot (legacy)
Build 7370: arc lint + arc unit

Event Timeline

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

Add remove operation to the stress test

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.

Use the NULLPTR trick to make boost happy

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