Our current safe mode database implementation uses a BTreeMap<Key, BTreeSet<Value>> to represent its data. This makes it so that we support the DUP_SORT database flag inherited from LMDB, which in turn allows multi-stores.
We don't use this in CRLite, so we'd incur a bit of overhead caused by the multiple levels of indirection. Making this distinction using the type system would either:
make our already convoluted generics soup even more soup-y, or
incur conditionals overhead when matching enums (e.g. Store(Single | Multi)), or
require dynamic dispatch (for example, for a boxed Store trait)
Signed-off-by: Victor Porof victor.porof@gmail.com
Our current safe mode database implementation uses a
BTreeMap<Key, BTreeSet<Value>>
to represent its data. This makes it so that we support theDUP_SORT
database flag inherited from LMDB, which in turn allows multi-stores.We don't use this in CRLite, so we'd incur a bit of overhead caused by the multiple levels of indirection. Making this distinction using the type system would either:
Store(Single | Multi)
), orSimplest way around this is just using features.