< Summary

Information
Class: SwiftCollections.SwiftGenerationalBucketState<T>
Assembly: SwiftCollections
File(s): /home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Serialization/State/SwiftGenerationalBucketState.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 46
Line coverage: 100%
Branch coverage
62%
Covered branches: 5
Total branches: 8
Branch coverage: 62.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)62.5%88100%

File(s)

/home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Serialization/State/SwiftGenerationalBucketState.cs

#LineLine coverage
 1using MemoryPack;
 2using System;
 3using System.Text.Json.Serialization;
 4
 5namespace SwiftCollections;
 6
 7[Serializable]
 8[MemoryPackable]
 9public readonly partial struct SwiftGenerationalBucketState<T>
 10{
 11    [JsonInclude]
 12    [MemoryPackInclude]
 13    public readonly T[] Items;
 14
 15    [JsonInclude]
 16    [MemoryPackInclude]
 17    public readonly bool[] Allocated;
 18
 19    [JsonInclude]
 20    [MemoryPackInclude]
 21    public readonly uint[] Generations;
 22
 23    [JsonInclude]
 24    [MemoryPackInclude]
 25    public readonly int[] FreeIndices;
 26
 27    [JsonInclude]
 28    [MemoryPackInclude]
 29    public readonly int Peak;
 30
 31    [JsonConstructor]
 32    [MemoryPackConstructor]
 33    public SwiftGenerationalBucketState(
 34        T[] items,
 35        bool[] allocated,
 36        uint[] generations,
 37        int[] freeIndices,
 38        int peak)
 539    {
 540        Items = items ?? Array.Empty<T>();
 541        Allocated = allocated ?? Array.Empty<bool>();
 542        Generations = generations ?? Array.Empty<uint>();
 543        FreeIndices = freeIndices ?? Array.Empty<int>();
 544        Peak = peak;
 545    }
 46}