From 696a7a4edc20fc78aa529fc76beea1e8f6e55b9c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 25 Dec 2020 00:46:35 +0000 Subject: [PATCH] cosmetics --- .../HypergridService/HGInstantMessageService.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index 25cd095f77..55e6b6572c 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs @@ -174,9 +174,8 @@ namespace OpenSim.Services.HypergridService lock (m_UserLocationMap) { - if (m_UserLocationMap.ContainsKey(toAgentID)) + if (m_UserLocationMap.TryGetValue(toAgentID, out object o)) { - object o = m_UserLocationMap[toAgentID]; if (o is PresenceInfo) upd = (PresenceInfo)o; else if (o is string) @@ -285,7 +284,7 @@ namespace OpenSim.Services.HypergridService { // IM delivery successful, so store the Agent's location in our local cache. lock (m_UserLocationMap) - m_UserLocationMap.Add(toAgentID, upd); + m_UserLocationMap[toAgentID] = upd; return true; } else @@ -307,16 +306,7 @@ namespace OpenSim.Services.HypergridService { // IM delivery successful, so store the Agent's location in our local cache. lock (m_UserLocationMap) - { - if (m_UserLocationMap.ContainsKey(toAgentID)) - { - m_UserLocationMap[toAgentID] = url; - } - else - { - m_UserLocationMap.Add(toAgentID, url); - } - } + m_UserLocationMap[toAgentID] = url; return true; }