< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 32
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
Equals(...)100%110%
Equals(...)0%220%
GetHashCode()100%110%
op_Equality(...)100%110%
op_Inequality(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/Encoding/LabelHandle.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.Diagnostics;
 5using System.Diagnostics.CodeAnalysis;
 6
 7namespace System.Reflection.Metadata.Ecma335
 8{
 9    public readonly struct LabelHandle : IEquatable<LabelHandle>
 10    {
 11        /// <summary>
 12        /// 1-based id identifying the label within the context of a <see cref="ControlFlowBuilder"/>.
 13        /// </summary>
 014        public int Id { get; }
 15
 16        internal LabelHandle(int id)
 017        {
 018            Debug.Assert(id >= 1);
 019            Id = id;
 020        }
 21
 022        public bool IsNil => Id == 0;
 23
 024        public bool Equals(LabelHandle other) => Id == other.Id;
 025        public override bool Equals([NotNullWhen(true)] object? obj) => obj is LabelHandle labelHandle && Equals(labelHa
 026        public override int GetHashCode() => Id.GetHashCode();
 27
 028        public static bool operator ==(LabelHandle left, LabelHandle right) => left.Equals(right);
 029        public static bool operator !=(LabelHandle left, LabelHandle right) => !left.Equals(right);
 30    }
 31}
 32