< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 23
Coverable lines: 23
Total lines: 65
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.cctor()100%110%
.ctor()100%110%
Equals(...)100%110%
Equals(...)100%110%
GetHashCode(...)100%110%
GetHashCode(...)100%110%
Compare(...)100%110%
Compare(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/HandleComparer.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Collections.Generic;
 5
 6namespace System.Reflection.Metadata
 7{
 8    public sealed class HandleComparer : IEqualityComparer<Handle>, IComparer<Handle>, IEqualityComparer<EntityHandle>, 
 9    {
 010        private static readonly HandleComparer s_default = new HandleComparer();
 11
 012        private HandleComparer()
 013        {
 014        }
 15
 16        public static HandleComparer Default
 17        {
 018            get { return s_default; }
 19        }
 20
 21        public bool Equals(Handle x, Handle y)
 022        {
 023            return x.Equals(y);
 024        }
 25
 26        public bool Equals(EntityHandle x, EntityHandle y)
 027        {
 028            return x.Equals(y);
 029        }
 30
 31        public int GetHashCode(Handle obj)
 032        {
 033            return obj.GetHashCode();
 034        }
 35
 36        public int GetHashCode(EntityHandle obj)
 037        {
 038            return obj.GetHashCode();
 039        }
 40
 41        /// <summary>
 42        /// Compares two handles.
 43        /// </summary>
 44        /// <remarks>
 45        /// The order of handles that differ in kind and are not <see cref="EntityHandle"/> is undefined.
 46        /// Returns 0 if and only if <see cref="Equals(Handle, Handle)"/> returns true.
 47        /// </remarks>
 48        public int Compare(Handle x, Handle y)
 049        {
 050            return Handle.Compare(x, y);
 051        }
 52
 53        /// <summary>
 54        /// Compares two entity handles.
 55        /// </summary>
 56        /// <remarks>
 57        /// Returns 0 if and only if <see cref="Equals(EntityHandle, EntityHandle)"/> returns true.
 58        /// </remarks>
 59        public int Compare(EntityHandle x, EntityHandle y)
 060        {
 061            return EntityHandle.Compare(x, y);
 062        }
 63    }
 64}
 65