Closed martindevans closed 11 months ago
I would prefer to Wrap them into preprocessor variables since branching comes with an overhead. And the whole Point of those unsafe collections is being fast ^^
I've added a preprocessor block around the checks and inlined the CheckIndex
method for good measure.
btw are you in the discord? If so ill make you a contributor there ^^
I just joined, I'm martindevans
on Discord too.
Added test coverage to the
UnsafeList
indexers.Also added bounds checking to the indexers. Two methods in
UnsafeList
deliberately access out of bounds (Add
andRemoveAt
) so I've modified those to go directly to the underlying_array
, bypassing the new checks).I considered wrapping the checks in an(This is now done).#if DEBUG
block, so there's no extra cost in release builds. Personally I think it's better to keep the checks, but that's an option if you'd prefer that?