1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 17:28:00 +02:00

Move assert

Place the assert before the allocation.
This commit is contained in:
Damian Day 2020-03-20 21:50:40 +00:00
parent 96c53d4a9e
commit 97501eacee

View file

@ -51,8 +51,8 @@ namespace System.Collections.Generic
[AllowAppend] [AllowAppend]
public this(int capacity) public this(int capacity)
{ {
Debug.Assert((uint)capacity <= (uint)SizeFlags);
T* items = append T[capacity]* (?); T* items = append T[capacity]* (?);
Debug.Assert(capacity >= 0);
mItems = items; mItems = items;
mHead = 0; mHead = 0;
mTail = 0; mTail = 0;