aboutsummaryrefslogtreecommitdiff
path: root/src/table/data.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-04-27 16:14:44 +0200
committerAlex Auvolat <alex@adnab.me>2023-06-09 16:23:37 +0200
commit6005491cd8adf569c0b7f88fc6b3af3f166963ea (patch)
treeb66f8a24d48eee04b43f0c20e58cb9c80696e903 /src/table/data.rs
parentea3bfd2ab107497c47718dec3c6c6cda45cd1a43 (diff)
downloadgarage-6005491cd8adf569c0b7f88fc6b3af3f166963ea.tar.gz
garage-6005491cd8adf569c0b7f88fc6b3af3f166963ea.zip
Use Cow<[u8]> for sort keys
Diffstat (limited to 'src/table/data.rs')
-rw-r--r--src/table/data.rs4
1 files changed, 1 insertions, 3 deletions
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<F: TableSchema, R: TableReplication> TableData<F, R> {
// ---- Utility functions ----
pub fn tree_key(&self, p: &F::P, s: &F::S) -> Vec<u8> {
- 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<F::E, Error> {