From fcc6977827d7137a33eb28935132c9f089975220 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 28 Jun 2019 14:52:13 -0700 Subject: [PATCH] Use compound assignment --- .../Core/Implementation/IntelliSense/Completion/Model.cs | 2 +- .../Core/Def/Implementation/Venus/ContainedDocument.cs | 2 +- src/Workspaces/Remote/ServiceHub/Shared/Extensions.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Model.cs b/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Model.cs index df7c6592ce8..79c06cb9238 100644 --- a/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Model.cs +++ b/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Model.cs @@ -266,7 +266,7 @@ internal SnapshotSpan GetCurrentSpanInSnapshot(ViewTextSpan originalSpan, ITextS var currentSpan = GetCurrentSpanInSnapshot(originalSpan, textSnapshot); var startPosition = currentSpan.Start; - var endPosition = endPoint.HasValue ? endPoint.Value : currentSpan.End; + var endPosition = endPoint ?? currentSpan.End; // TODO(cyrusn): What to do if the span is empty, or the end comes before the start. // Can that even happen? Not sure, so we'll just be resilient just in case. diff --git a/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs b/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs index 7bf8da22686..65210e089ef 100644 --- a/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs +++ b/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs @@ -589,7 +589,7 @@ private IHierarchicalDifferenceCollection DiffStrings(string leftTextWithReplace var diffService = _differenceSelectorService.GetTextDifferencingService( _workspace.Services.GetLanguageServices(_project.Language).GetService().GetDefaultContentType()); - diffService = diffService ?? _differenceSelectorService.DefaultTextDifferencingService; + diffService ??= _differenceSelectorService.DefaultTextDifferencingService; return diffService.DiffStrings(leftTextWithReplacement, rightTextWithReplacement, s_venusEditOptions.DifferenceOptions); } diff --git a/src/Workspaces/Remote/ServiceHub/Shared/Extensions.cs b/src/Workspaces/Remote/ServiceHub/Shared/Extensions.cs index 48baf842fcf..01d2db0812a 100644 --- a/src/Workspaces/Remote/ServiceHub/Shared/Extensions.cs +++ b/src/Workspaces/Remote/ServiceHub/Shared/Extensions.cs @@ -23,7 +23,7 @@ internal static partial class Extensions TraceSource logger, IEnumerable jsonConverters = null) { - jsonConverters = jsonConverters ?? SpecializedCollections.EmptyEnumerable(); + jsonConverters ??= SpecializedCollections.EmptyEnumerable(); var jsonFormatter = new JsonMessageFormatter(); jsonFormatter.JsonSerializer.Converters.AddRange(jsonConverters.Concat(AggregateJsonConverter.Instance)); -- GitLab