< Summary

Information
Class: SwiftCollections.SwiftBucketState<T>
Assembly: SwiftCollections
File(s): /home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Serialization/State/SwiftBucketState.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 36
Line coverage: 100%
Branch coverage
66%
Covered branches: 4
Total branches: 6
Branch coverage: 66.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)66.66%66100%

File(s)

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

#LineLine coverage
 1using MemoryPack;
 2using System;
 3using System.Text.Json.Serialization;
 4
 5namespace SwiftCollections;
 6
 7[Serializable]
 8[MemoryPackable]
 9public readonly partial struct SwiftBucketState<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 int[] FreeIndices;
 22
 23    [JsonInclude]
 24    [MemoryPackInclude]
 25    public readonly int PeakCount;
 26
 27    [JsonConstructor]
 28    [MemoryPackConstructor]
 29    public SwiftBucketState(T[] items, bool[] allocated, int[] freeIndices, int peakCount)
 530    {
 531        Items = items ?? Array.Empty<T>();
 532        Allocated = allocated ?? Array.Empty<bool>();
 533        FreeIndices = freeIndices ?? Array.Empty<int>();
 534        PeakCount = peakCount;
 535    }
 36}