From 435aefe1bf753a4ad7507e42bb01d6864c4abcce Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 24 Oct 2011 23:26:41 +0100 Subject: [PATCH] Drop some unnecessary ContainsKey() checking before Remove() in BaseHttpServer() Remove() presumably does this check anyway since it just returns false if the key is not in the collection. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 039e1f234c..3b90ea7358 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1814,12 +1814,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void RemovePollServiceHTTPHandler(string httpMethod, string path) { lock (m_pollHandlers) - { - if (m_pollHandlers.ContainsKey(path)) - { - m_pollHandlers.Remove(path); - } - } + m_pollHandlers.Remove(path); RemoveHTTPHandler(httpMethod, path); } @@ -1843,12 +1838,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void RemoveXmlRPCHandler(string method) { lock (m_rpcHandlers) - { - if (m_rpcHandlers.ContainsKey(method)) - { - m_rpcHandlers.Remove(method); - } - } + m_rpcHandlers.Remove(method); } public bool RemoveLLSDHandler(string path, LLSDMethod handler)