[Applications.Common] Fix Handler of GSourceManager (#1767)
authorhjhun <36876573+hjhun@users.noreply.github.com>
Tue, 30 Jun 2020 03:34:33 +0000 (12:34 +0900)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2020 03:34:33 +0000 (12:34 +0900)
This patch removes using ContainsKey() of ConcurrentDictionary.

Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 799b0bf..ca900a5
@@ -120,10 +120,8 @@ namespace Tizen.Applications
             private static bool Handler(IntPtr userData)
             {
                 int key = (int)userData;
-                if (_handlerMap.ContainsKey(key))
+                if (_handlerMap.TryRemove(key, out Action action))
                 {
-                    Action action;
-                    _handlerMap.TryRemove(key, out action);
                     action?.Invoke();
                 }
                 return false;