crypto: Simplify the signature loading in the sqlite cryptostore.

master
Damir Jelić 2020-09-02 12:24:46 +02:00
parent 8b56546565
commit 65843f89dc
1 changed files with 7 additions and 9 deletions

View File

@ -551,12 +551,10 @@ impl SqliteStore {
let signature = row.2;
if !signatures.contains_key(&user_id) {
let _ = signatures.insert(user_id.clone(), BTreeMap::new());
}
let user_map = signatures.get_mut(&user_id).unwrap();
user_map.insert(
signatures
.entry(user_id)
.or_insert_with(BTreeMap::new)
.insert(
DeviceKeyId::from_parts(key_algorithm, device_id.as_str().into()),
signature.to_owned(),
);