diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-11-15 13:48:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-15 13:48:43 +0100 |
| commit | 7caf1662eca2ea8826f3277e8b9d5c8c782fd03d (patch) | |
| tree | 526c116a04f01a13202b575e0a923baf6c7e3a48 /RSSDP/HttpParserBase.cs | |
| parent | 331c7f84817ae2c6897cc60d16a5d66b27f3f187 (diff) | |
| parent | d4e568c8bf1e5312075225c5554eeffb5335fd47 (diff) | |
Merge pull request #4478 from Bond-009/chararray
Don't allocate single char arrays when possible
Diffstat (limited to 'RSSDP/HttpParserBase.cs')
| -rw-r--r-- | RSSDP/HttpParserBase.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/RSSDP/HttpParserBase.cs b/RSSDP/HttpParserBase.cs index a40612bc2..11202940e 100644 --- a/RSSDP/HttpParserBase.cs +++ b/RSSDP/HttpParserBase.cs @@ -119,7 +119,7 @@ namespace Rssdp.Infrastructure } else { - headersToAddTo.TryAddWithoutValidation(headerName, values.First()); + headersToAddTo.TryAddWithoutValidation(headerName, values[0]); } } @@ -151,7 +151,7 @@ namespace Rssdp.Infrastructure return lineIndex; } - private IList<string> ParseValues(string headerValue) + private List<string> ParseValues(string headerValue) { // This really should be better and match the HTTP 1.1 spec, // but this should actually be good enough for SSDP implementations @@ -160,7 +160,7 @@ namespace Rssdp.Infrastructure if (headerValue == "\"\"") { - values.Add(String.Empty); + values.Add(string.Empty); return values; } @@ -172,7 +172,7 @@ namespace Rssdp.Infrastructure else { var segments = headerValue.Split(SeparatorCharacters); - if (headerValue.Contains("\"")) + if (headerValue.Contains('"')) { for (int segmentIndex = 0; segmentIndex < segments.Length; segmentIndex++) { |
