From 0e370a8e19637f6e266dd6458a102c94465f2227 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Fri, 9 Sep 2022 17:39:28 +0200 Subject: [PATCH] refactor: Use synchronized's return --- lib/src/omemo/sessionmanager.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/src/omemo/sessionmanager.dart b/lib/src/omemo/sessionmanager.dart index c8c6a76..ab4fb4a 100644 --- a/lib/src/omemo/sessionmanager.dart +++ b/lib/src/omemo/sessionmanager.dart @@ -415,13 +415,7 @@ class OmemoSessionManager { /// Returns the device map, i.e. the mapping of bare Jid to its device identifiers /// we have built sessions with. Future>> getDeviceMap() async { - Map>? map; - - await _lock.synchronized(() async { - map = _deviceMap; - }); - - return map!; + return _lock.synchronized(() => _deviceMap); } /// Removes the ratchet identified by [jid] and [deviceId] from the session manager.