mozilla / rkv

A simple, humane, typed key-value storage solution.
https://crates.io/crates/rkv
Apache License 2.0
307 stars 52 forks source link

Don't allocate when creating 'from' and 'dup_of' iterators #176

Closed victorporof closed 4 years ago

victorporof commented 4 years ago

We're reallocating keys when creating 'from' and 'dup_of' iterators. In practice, this isn't necessary as long as we require keys to live at least as long as the iterators themselves, which is always going to be true.

This PR adds a lifetime constraint for those situations, removing the need for a reallocation.

Signed-off-by: Victor Porof victor.porof@gmail.com