From 8ba243c0f6fd35b42755c6468f5e9fe5a003d24e Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Fri, 7 Feb 2020 11:15:15 -0800 Subject: [PATCH] PR feedback --- .../CodeAnalysisResourcesLocalizableErrorArgument.cs | 2 +- src/Compilers/Core/Portable/InternalUtilities/WeakList.cs | 5 ++--- src/Compilers/Core/Portable/TreeDumper.cs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Compilers/Core/Portable/CodeAnalysisResourcesLocalizableErrorArgument.cs b/src/Compilers/Core/Portable/CodeAnalysisResourcesLocalizableErrorArgument.cs index 771eb910f52..980f8daeb06 100644 --- a/src/Compilers/Core/Portable/CodeAnalysisResourcesLocalizableErrorArgument.cs +++ b/src/Compilers/Core/Portable/CodeAnalysisResourcesLocalizableErrorArgument.cs @@ -30,7 +30,7 @@ public string ToString(string? format, IFormatProvider? formatProvider) { if (_targetResourceId != null) { - return CodeAnalysisResources.ResourceManager.GetString(_targetResourceId, formatProvider as System.Globalization.CultureInfo) ?? ""; + return CodeAnalysisResources.ResourceManager.GetString(_targetResourceId, formatProvider as System.Globalization.CultureInfo) ?? string.Empty; } return string.Empty; diff --git a/src/Compilers/Core/Portable/InternalUtilities/WeakList.cs b/src/Compilers/Core/Portable/InternalUtilities/WeakList.cs index 8f0833fbf61..2568dfc730b 100644 --- a/src/Compilers/Core/Portable/InternalUtilities/WeakList.cs +++ b/src/Compilers/Core/Portable/InternalUtilities/WeakList.cs @@ -33,7 +33,7 @@ private void Resize() int firstDead = -1; for (int i = 0; i < _items.Length; i++) { - if (!_items[i].TryGetTarget(out var _)) + if (!_items[i].TryGetTarget(out _)) { if (firstDead == -1) { @@ -112,8 +112,7 @@ private void Compact(int firstDead, WeakReference[] result) { var item = _items[i]; - T? target; - if (item.TryGetTarget(out target)) + if (item.TryGetTarget(out _)) { result[j++] = item; } diff --git a/src/Compilers/Core/Portable/TreeDumper.cs b/src/Compilers/Core/Portable/TreeDumper.cs index 6a1f4608474..db05bb5d689 100644 --- a/src/Compilers/Core/Portable/TreeDumper.cs +++ b/src/Compilers/Core/Portable/TreeDumper.cs @@ -205,7 +205,7 @@ protected virtual string DumperString(object o) return symbol.ToDisplayString(SymbolDisplayFormat.TestFormat); } - return o?.ToString() ?? ""; + return o.ToString() ?? ""; } } -- GitLab