mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11:24 +01:00
Convert giant tuple in state_compressor to struct
This commit is contained in:
parent
8d09a7e490
commit
edfccea30a
4 changed files with 39 additions and 61 deletions
|
|
@ -20,7 +20,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
|
|||
.load_shortstatehash_info(shortstatehash)?
|
||||
.pop()
|
||||
.expect("there is always one layer")
|
||||
.1;
|
||||
.full_state;
|
||||
let mut result = HashMap::new();
|
||||
let mut i = 0;
|
||||
for compressed in full_state.iter() {
|
||||
|
|
@ -48,7 +48,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
|
|||
.load_shortstatehash_info(shortstatehash)?
|
||||
.pop()
|
||||
.expect("there is always one layer")
|
||||
.1;
|
||||
.full_state;
|
||||
|
||||
let mut result = HashMap::new();
|
||||
let mut i = 0;
|
||||
|
|
@ -102,7 +102,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
|
|||
.load_shortstatehash_info(shortstatehash)?
|
||||
.pop()
|
||||
.expect("there is always one layer")
|
||||
.1;
|
||||
.full_state;
|
||||
Ok(full_state
|
||||
.iter()
|
||||
.find(|bytes| bytes.starts_with(&shortstatekey.to_be_bytes()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue