From e7b62f0dbf673f7a0e442348717c4ffa060dfc0a Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Sun, 14 Dec 2025 04:44:02 +0800 Subject: [PATCH] Use Span in b2Chain_GetSegments for consistency --- src/Box2D.NET/B2Shapes.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Box2D.NET/B2Shapes.cs b/src/Box2D.NET/B2Shapes.cs index 009b6965..2b583304 100644 --- a/src/Box2D.NET/B2Shapes.cs +++ b/src/Box2D.NET/B2Shapes.cs @@ -586,7 +586,7 @@ public static int b2Chain_GetSegmentCount(B2ChainId chainId) return chain.count; } - public static int b2Chain_GetSegments(B2ChainId chainId, B2ShapeId[] segmentArray, int capacity) + public static int b2Chain_GetSegments(B2ChainId chainId, Span segments, int capacity) { B2World world = b2GetWorldLocked(chainId.world0); if (world == null) @@ -601,7 +601,7 @@ public static int b2Chain_GetSegments(B2ChainId chainId, B2ShapeId[] segmentArra { int shapeId = chain.shapeIndices[i]; B2Shape shape = b2Array_Get(ref world.shapes, shapeId); - segmentArray[i] = new B2ShapeId(shapeId + 1, chainId.world0, shape.generation); + segments[i] = new B2ShapeId(shapeId + 1, chainId.world0, shape.generation); } return count;