optimize get w/ zero-copy ref handle

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-02 05:56:10 +00:00
parent 0522fe7d92
commit ee64fb149c
11 changed files with 46 additions and 16 deletions

View file

@ -479,7 +479,7 @@ async fn db_lt_8(db: &Arc<Database>, _config: &Config) -> Result<()> {
.unwrap()
.expect("shortroomid should exist");
let mut new_key = short_room_id;
let mut new_key = short_room_id.to_vec();
new_key.extend_from_slice(count);
Some((new_key, v))
@ -500,7 +500,7 @@ async fn db_lt_8(db: &Arc<Database>, _config: &Config) -> Result<()> {
.unwrap()
.expect("shortroomid should exist");
let mut new_value = short_room_id;
let mut new_value = short_room_id.to_vec();
new_value.extend_from_slice(count);
Some((k, new_value))
@ -534,7 +534,7 @@ async fn db_lt_9(db: &Arc<Database>, _config: &Config) -> Result<()> {
.get(room_id)
.unwrap()
.expect("shortroomid should exist");
let mut new_key = short_room_id;
let mut new_key = short_room_id.to_vec();
new_key.extend_from_slice(word);
new_key.push(0xFF);
new_key.extend_from_slice(pdu_id_count);