refactor: Use synchronized's return
This commit is contained in:
@@ -415,13 +415,7 @@ class OmemoSessionManager {
|
|||||||
/// Returns the device map, i.e. the mapping of bare Jid to its device identifiers
|
/// Returns the device map, i.e. the mapping of bare Jid to its device identifiers
|
||||||
/// we have built sessions with.
|
/// we have built sessions with.
|
||||||
Future<Map<String, List<int>>> getDeviceMap() async {
|
Future<Map<String, List<int>>> getDeviceMap() async {
|
||||||
Map<String, List<int>>? map;
|
return _lock.synchronized(() => _deviceMap);
|
||||||
|
|
||||||
await _lock.synchronized(() async {
|
|
||||||
map = _deviceMap;
|
|
||||||
});
|
|
||||||
|
|
||||||
return map!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes the ratchet identified by [jid] and [deviceId] from the session manager.
|
/// Removes the ratchet identified by [jid] and [deviceId] from the session manager.
|
||||||
|
|||||||
Reference in New Issue
Block a user