optimize get w/ zero-copy ref handle
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
0522fe7d92
commit
ee64fb149c
11 changed files with 46 additions and 16 deletions
|
@ -31,7 +31,7 @@ impl Data {
|
|||
|
||||
pub(super) fn existing_txnid(
|
||||
&self, user_id: &UserId, device_id: Option<&DeviceId>, txn_id: &TransactionId,
|
||||
) -> Result<Option<Vec<u8>>> {
|
||||
) -> Result<Option<database::Handle<'_>>> {
|
||||
let mut key = user_id.as_bytes().to_vec();
|
||||
key.push(0xFF);
|
||||
key.extend_from_slice(device_id.map(DeviceId::as_bytes).unwrap_or_default());
|
||||
|
|
|
@ -26,7 +26,7 @@ impl Service {
|
|||
|
||||
pub fn existing_txnid(
|
||||
&self, user_id: &UserId, device_id: Option<&DeviceId>, txn_id: &TransactionId,
|
||||
) -> Result<Option<Vec<u8>>> {
|
||||
) -> Result<Option<database::Handle<'_>>> {
|
||||
self.db.existing_txnid(user_id, device_id, txn_id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue