Call the method fork instead of clone and add proper comments

This commit is contained in:
Santiago Pastorino 2022-02-09 19:37:10 -03:00
parent 3fd89a662a
commit f4bb4500dd
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
9 changed files with 36 additions and 3 deletions

View file

@ -13,6 +13,7 @@ mod tests;
pub type SnapshotMapStorage<K, V> = SnapshotMap<K, V, FxHashMap<K, V>, ()>;
pub type SnapshotMapRef<'a, K, V, L> = SnapshotMap<K, V, &'a mut FxHashMap<K, V>, &'a mut L>;
#[derive(Clone)]
pub struct SnapshotMap<K, V, M = FxHashMap<K, V>, L = VecLog<UndoLog<K, V>>> {
map: M,
undo_log: L,
@ -30,6 +31,7 @@ where
}
}
#[derive(Clone)]
pub enum UndoLog<K, V> {
Inserted(K),
Overwrite(K, V),