Use specific key,val buffer sizes for append_to_state (no change to correctness).

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-09-29 03:32:12 +00:00
parent ae4aad3641
commit 1058fbe9a7

View File

@@ -262,7 +262,8 @@ pub async fn set_event_state(
)
)]
pub async fn append_to_state(&self, new_pdu: &PduEvent) -> Result<u64> {
const BUFSIZE: usize = size_of::<u64>();
const KEY_LEN: usize = size_of::<ShortEventId>();
const VAL_LEN: usize = size_of::<ShortStateHash>();
let shorteventid = self
.services
@@ -277,7 +278,7 @@ pub async fn append_to_state(&self, new_pdu: &PduEvent) -> Result<u64> {
if let Ok(p) = previous_shortstatehash {
self.db
.shorteventid_shortstatehash
.aput::<BUFSIZE, BUFSIZE, _, _>(shorteventid, p);
.aput::<KEY_LEN, VAL_LEN, _, _>(shorteventid, p);
}
match &new_pdu.state_key {