Closed yejiayu closed 5 years ago
If the
node
is modified at the time ofinsert
but an error occurs during the process, the necessaryclone
ensure that thenode
is consistent with the one before theinsert
.
Should the clone
in remove
function also be modified to take
?
There is a problem with replacing clone
with take
. see https://github.com/cryptape/cita-trie/pull/18#discussion_r264109426
A viable solution was mentioned in the comments, but the code modification was a bit large. I have not thought of an elegant solution.
If the
node
is modified at the time ofinsert
but an error occurs during the process, the necessaryclone
ensure that thenode
is consistent with the one before theinsert
.