< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 30
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%
GetGuid(...)0%220%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/GuidHeap.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.Reflection.Internal;
 5
 6namespace System.Reflection.Metadata.Ecma335
 7{
 8    internal readonly struct GuidHeap
 9    {
 10        internal readonly MemoryBlock Block;
 11
 12        public GuidHeap(MemoryBlock block)
 013        {
 014            this.Block = block;
 015        }
 16
 17        internal Guid GetGuid(GuidHandle handle)
 018        {
 019            if (handle.IsNil)
 020            {
 021                return default(Guid);
 22            }
 23
 24            // Metadata Spec: The Guid heap is an array of GUIDs, each 16 bytes wide.
 25            // Its first element is numbered 1, its second 2, and so on.
 026            return this.Block.PeekGuid((handle.Index - 1) * BlobUtilities.SizeOfGuid);
 027        }
 28    }
 29}
 30