rippled icon indicating copy to clipboard operation
rippled copied to clipboard

Prevent unnecessary `shared_ptr` copies by accepting a value in `SHAMapInnerNode::setChild`

Open greg7mdp opened this issue 3 years ago • 0 comments

High Level Overview of Change

Because SHAMapInnerNode::setChild takes a shared_ptr const &, every node insertion requires a shared_ptr copy, which causes an increment/decrement of the refcount in the object. This PR makes SHAMapInnerNode::setChild take a value which is moved into place.

Context of Change

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ x] Refactor (non-breaking change that only restructures code)
  • [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
  • [ ] Documentation Updates
  • [ ] Release

This does not cause any functional change.

greg7mdp avatar Aug 04 '22 20:08 greg7mdp