Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00c5d3b

Browse filesBrowse files
Fix CodeQL suggestion
1 parent ccf70c4 commit 00c5d3b
Copy full SHA for 00c5d3b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-10
lines changed

‎src/AspNet/WebApi/src/Asp.Versioning.WebApi/System.Net.Http/HttpResponseMessageExtensions.cs

Copy file name to clipboardExpand all lines: src/AspNet/WebApi/src/Asp.Versioning.WebApi/System.Net.Http/HttpResponseMessageExtensions.cs
+3-10Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,9 @@ public static void WriteSunsetPolicy( this HttpResponseMessage response, SunsetP
4444

4545
private static void AddLinkHeaders( HttpResponseHeaders headers, IList<LinkHeaderValue> links )
4646
{
47-
ICollection<string> values;
48-
49-
if ( headers.TryGetValues( Link, out var existing ) )
50-
{
51-
values = existing is ICollection<string> collection && !collection.IsReadOnly ? collection : new List<string>( existing );
52-
}
53-
else
54-
{
55-
values = new List<string>( capacity: links.Count );
56-
}
47+
var values = headers.TryGetValues( Link, out var existing )
48+
? existing is ICollection<string> collection && !collection.IsReadOnly ? collection : new List<string>( existing )
49+
: new List<string>( capacity: links.Count );
5750

5851
for ( var i = 0; i < links.Count; i++ )
5952
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.