< Summary

Information
Class: SwiftCollections.Query.QueryTraversalScratch
Assembly: SwiftCollections
File(s): /home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Query/Shared/QueryTraversalScratch.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 28
Line coverage: 100%
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 Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
RentIntStack(...)100%11100%

File(s)

/home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Query/Shared/QueryTraversalScratch.cs

#LineLine coverage
 1//=======================================================================
 2// QueryTraversalScratch.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024–present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using System.Threading;
 9
 10namespace SwiftCollections.Query;
 11
 12internal sealed class QueryTraversalScratch
 13{
 14    private readonly ThreadLocal<SwiftIntStack> _intStack;
 15
 4516    public QueryTraversalScratch()
 17    {
 4518        _intStack = new ThreadLocal<SwiftIntStack>(() => new SwiftIntStack(0));
 4519    }
 20
 21    public SwiftIntStack RentIntStack(int capacity)
 22    {
 2923        SwiftIntStack stack = _intStack.Value!;
 2924        stack.EnsureCapacity(capacity);
 2925        stack.Clear();
 2926        return stack;
 27    }
 28}

Methods/Properties

.ctor()
RentIntStack(System.Int32)