HomePhabricator

rust-nodemap: mutable NodeTree data structure

Authored by gracinet.

Description

rust-nodemap: mutable NodeTree data structure

Thanks to the previously indexing abstraction,
the only difference in the lookup algorithm is that we
don't need the special case for an empty NodeTree any more.

We've considered making the mutable root an Option<Block>,
but that leads to unpleasant checks and unwrap() unless we
abstract it as typestate patterns (NodeTree<Immutable> and
NodeTree<Mutated>) which seem exaggerated in that
case.

The initial copy of the root block is a very minor
performance penalty, given that it typically occurs just once
per transaction.

Differential Revision: https://phab.mercurial-scm.org/D7793

Details

Committed
gracinetDec 27 2019, 9:11 AM
Differential Revision
D7793: rust-nodemap: mutable NodeTree data structure
Parents
rHG220d4d2e3185: rust-nodemap: abstracting the indexing
Branches
Unknown
Tags
Unknown