提交 fcc69778 编写于 作者: C Cyrus Najmabadi

Use compound assignment

上级 94ee71e0
......@@ -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.
......
......@@ -589,7 +589,7 @@ private IHierarchicalDifferenceCollection DiffStrings(string leftTextWithReplace
var diffService = _differenceSelectorService.GetTextDifferencingService(
_workspace.Services.GetLanguageServices(_project.Language).GetService<IContentTypeLanguageService>().GetDefaultContentType());
diffService = diffService ?? _differenceSelectorService.DefaultTextDifferencingService;
diffService ??= _differenceSelectorService.DefaultTextDifferencingService;
return diffService.DiffStrings(leftTextWithReplacement, rightTextWithReplacement, s_venusEditOptions.DifferenceOptions);
}
......
......@@ -23,7 +23,7 @@ internal static partial class Extensions
TraceSource logger,
IEnumerable<JsonConverter> jsonConverters = null)
{
jsonConverters = jsonConverters ?? SpecializedCollections.EmptyEnumerable<JsonConverter>();
jsonConverters ??= SpecializedCollections.EmptyEnumerable<JsonConverter>();
var jsonFormatter = new JsonMessageFormatter();
jsonFormatter.JsonSerializer.Converters.AddRange(jsonConverters.Concat(AggregateJsonConverter.Instance));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册