changeset 52:aeb014cb04cf

Change memtable to take slices, not Vecs
author Lewin Bormann <lbo@spheniscida.de>
date Sun, 19 Jun 2016 16:51:39 +0200
parents 1e2c21168116
children 0a15ae7ea36c
files src/memtable.rs
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/memtable.rs	Sun Jun 19 16:51:29 2016 +0200
+++ b/src/memtable.rs	Sun Jun 19 16:51:39 2016 +0200
@@ -72,7 +72,7 @@
         self.map.approx_memory()
     }
 
-    pub fn add(&mut self, seq: SequenceNumber, t: ValueType, key: &Vec<u8>, value: &Vec<u8>) {
+    pub fn add(&mut self, seq: SequenceNumber, t: ValueType, key: &[u8], value: &[u8]) {
         self.map.insert(Self::build_memtable_key(key, value, t, seq), Vec::new())
     }
 
@@ -80,8 +80,8 @@
     /// builds such a key. It's called key because the underlying Map implementation will only be
     /// concerned with keys; the value field is not used (instead, the value is encoded in the key,
     /// and for lookups we just search for the next bigger entry).
-    fn build_memtable_key(key: &Vec<u8>,
-                          value: &Vec<u8>,
+    fn build_memtable_key(key: &[u8],
+                          value: &[u8],
                           t: ValueType,
                           seq: SequenceNumber)
                           -> Vec<u8> {