Refactor counter increment sites for TwoPhaseCounter.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-24 00:15:33 +00:00
parent 05bb1f4ac7
commit 0fcb072239
21 changed files with 129 additions and 117 deletions

View File

@@ -305,7 +305,7 @@ impl Service {
}
// TODO: statehash with deterministic inputs
let shortstatehash = self.services.globals.next_count()?;
let shortstatehash = self.services.globals.next_count();
let mut statediffnew = CompressedState::new();
statediffnew.insert(new);
@@ -318,14 +318,14 @@ impl Service {
self.services
.state_compressor
.save_state_from_diff(
shortstatehash,
*shortstatehash,
Arc::new(statediffnew),
Arc::new(statediffremoved),
2,
states_parents,
)?;
Ok(shortstatehash)
Ok(*shortstatehash)
},
| _ =>
Ok(previous_shortstatehash.expect("first event in room must be a state event")),