Skip to content

Commit 83a701a

Browse files
Happypig375ikpil
authored andcommitted
Use Span in b2Chain_GetSegments for consistency
1 parent 4471c75 commit 83a701a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Box2D.NET/B2Shapes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public static int b2Chain_GetSegmentCount(B2ChainId chainId)
586586
return chain.count;
587587
}
588588

589-
public static int b2Chain_GetSegments(B2ChainId chainId, B2ShapeId[] segmentArray, int capacity)
589+
public static int b2Chain_GetSegments(B2ChainId chainId, Span<B2ShapeId> segments, int capacity)
590590
{
591591
B2World world = b2GetWorldLocked(chainId.world0);
592592
if (world == null)
@@ -601,7 +601,7 @@ public static int b2Chain_GetSegments(B2ChainId chainId, B2ShapeId[] segmentArra
601601
{
602602
int shapeId = chain.shapeIndices[i];
603603
B2Shape shape = b2Array_Get(ref world.shapes, shapeId);
604-
segmentArray[i] = new B2ShapeId(shapeId + 1, chainId.world0, shape.generation);
604+
segments[i] = new B2ShapeId(shapeId + 1, chainId.world0, shape.generation);
605605
}
606606

607607
return count;

0 commit comments

Comments
 (0)