Skip to content

Commit 566de97

Browse files
authored
Enable IDE0030 (Use coalesce expression) (#70948)
1 parent b8d9a74 commit 566de97

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

eng/CodeAnalysis.src.globalconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ dotnet_diagnostic.IDE0028.severity = suggestion
13861386
dotnet_diagnostic.IDE0029.severity = warning
13871387

13881388
# IDE0030: Use coalesce expression
1389-
dotnet_diagnostic.IDE0030.severity = suggestion
1389+
dotnet_diagnostic.IDE0030.severity = warning
13901390

13911391
# IDE0031: Use null propagation
13921392
dotnet_diagnostic.IDE0031.severity = silent

src/libraries/System.Net.Requests/src/System/Net/HttpWebResponse.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ public override long ContentLength
8080
get
8181
{
8282
CheckDisposed();
83-
long? length = _httpResponseMessage.Content?.Headers.ContentLength;
84-
return length.HasValue ? length.Value : -1;
83+
return _httpResponseMessage.Content?.Headers.ContentLength ?? -1;
8584
}
8685
}
8786

0 commit comments

Comments
 (0)