From a9abecc4265db627438f3363d792ef2f3f7a4831 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Thu, 13 Jun 2024 10:09:25 -0700 Subject: [PATCH] Fix some issues raised in pull request --- src/dotnet/APIView/APIView/APIView.csproj | 1 - src/dotnet/APIView/APIView/Model/CodeDiagnostic.cs | 2 -- src/dotnet/APIView/APIView/Model/TokenTreeModel.cs | 7 +++---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/dotnet/APIView/APIView/APIView.csproj b/src/dotnet/APIView/APIView/APIView.csproj index afcb55f8038f..bb6b6fc03767 100644 --- a/src/dotnet/APIView/APIView/APIView.csproj +++ b/src/dotnet/APIView/APIView/APIView.csproj @@ -18,7 +18,6 @@ - diff --git a/src/dotnet/APIView/APIView/Model/CodeDiagnostic.cs b/src/dotnet/APIView/APIView/Model/CodeDiagnostic.cs index afa7e5f60e75..27c6d9eae7a7 100644 --- a/src/dotnet/APIView/APIView/Model/CodeDiagnostic.cs +++ b/src/dotnet/APIView/APIView/Model/CodeDiagnostic.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Newtonsoft.Json; - namespace APIView { public class CodeDiagnostic diff --git a/src/dotnet/APIView/APIView/Model/TokenTreeModel.cs b/src/dotnet/APIView/APIView/Model/TokenTreeModel.cs index 6d585e78efb8..55d5a498b4bb 100644 --- a/src/dotnet/APIView/APIView/Model/TokenTreeModel.cs +++ b/src/dotnet/APIView/APIView/Model/TokenTreeModel.cs @@ -39,7 +39,7 @@ public HashSet RenderClasses } public string Value { get; set; } = string.Empty; public string Id { get; set; } - public StructuredTokenKind Kind { get; set; } + public StructuredTokenKind Kind { get; set; } = StructuredTokenKind.Content; [JsonIgnore] public HashSet TagsObj { get; set; } = new HashSet(); [JsonIgnore] @@ -209,12 +209,11 @@ public override int GetHashCode() public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) + var other = obj as APITreeNode; + if (other == null) { return false; } - - var other = (APITreeNode)obj; return Name == other.Name && Id == other.Id && Kind == other.Kind; }