Skip to content

Commit 0d8a85c

Browse files
Fix warnings in CompareViewModel
1 parent f0c80e4 commit 0d8a85c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ILSpy/ViewModels/CompareViewModel.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class CompareViewModel : ObservableObject
5151
private readonly AssemblyTreeModel assemblyTreeModel;
5252
private LoadedAssembly leftAssembly;
5353
private LoadedAssembly rightAssembly;
54-
[AllowNull]
55-
private LoadedAssembly[] assemblies;
5654
private ComparisonEntryTreeNode root;
5755
private bool updating = false;
5856
private bool showIdentical;
@@ -239,7 +237,12 @@ IEnumerable<object> GetChanges(List<Entry>? entries)
239237
continue;
240238
yield return new {
241239
name = GetEntityText(item.Entity),
242-
operation = item.Kind switch { DiffKind.Add => "added", DiffKind.Remove => "removed", DiffKind.Update => "changed" }
240+
operation = item.Kind switch {
241+
DiffKind.Add => "added",
242+
DiffKind.Remove => "removed",
243+
DiffKind.Update => "changed",
244+
_ => throw new InvalidOperationException($"Unexpected DiffKind: {item.Kind}"),
245+
}
243246
};
244247
}
245248
}
@@ -352,7 +355,7 @@ Entry MergeTrees(Entry a, Entry b)
352355
{
353356
if (!namespaceEntries.TryGetValue(typeDef.Namespace, out var nsEntry))
354357
{
355-
namespaceEntries[typeDef.Namespace] = nsEntry = new Entry { Parent = root, Signature = typeDef.Namespace, Entity = ResolveNamespace(typeDef.Namespace, typeDef.ParentModule)! };
358+
namespaceEntries[typeDef.Namespace] = nsEntry = new Entry { Parent = root, Signature = typeDef.Namespace, Entity = ResolveNamespace(typeDef.Namespace, typeDef.ParentModule!)! };
356359
root.Children ??= new();
357360
root.Children.Add(nsEntry);
358361
}

0 commit comments

Comments
 (0)