From 6005491cd8adf569c0b7f88fc6b3af3f166963ea Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 27 Apr 2023 16:14:44 +0200 Subject: Use Cow<[u8]> for sort keys --- src/table/data.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/table/data.rs') diff --git a/src/table/data.rs b/src/table/data.rs index 26cc3a5a..cfc67c18 100644 --- a/src/table/data.rs +++ b/src/table/data.rs @@ -347,9 +347,7 @@ impl TableData { // ---- Utility functions ---- pub fn tree_key(&self, p: &F::P, s: &F::S) -> Vec { - let mut ret = p.hash().to_vec(); - ret.extend(s.sort_key()); - ret + [p.hash().as_slice(), s.sort_key().as_ref()].concat() } pub fn decode_entry(&self, bytes: &[u8]) -> Result { -- cgit v1.2.3 From 53bf2f070cd3ef95bbdf78e439dbeb2d8cda8f19 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 9 May 2023 12:38:55 +0200 Subject: undo sort_key() returning Cow --- src/table/data.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/table/data.rs') diff --git a/src/table/data.rs b/src/table/data.rs index cfc67c18..73fa93c8 100644 --- a/src/table/data.rs +++ b/src/table/data.rs @@ -347,7 +347,7 @@ impl TableData { // ---- Utility functions ---- pub fn tree_key(&self, p: &F::P, s: &F::S) -> Vec { - [p.hash().as_slice(), s.sort_key().as_ref()].concat() + [p.hash().as_slice(), s.sort_key()].concat() } pub fn decode_entry(&self, bytes: &[u8]) -> Result { -- cgit v1.2.3