From 53c941c869271ced90682de5a5210dc78e37ea40 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 19 Mar 2020 21:52:33 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/WebHeaderCollection.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index 4189c9b9..695af5f3 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -923,9 +923,12 @@ namespace WebSocketSharp.Net private static HttpHeaderInfo getHeaderInfo (string name) { - foreach (var info in _headers.Values) - if (info.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase)) - return info; + var comparison = StringComparison.InvariantCultureIgnoreCase; + + foreach (var headerInfo in _headers.Values) { + if (headerInfo.Name.Equals (name, comparison)) + return headerInfo; + } return null; }