Skip to content

Refactor: Use 'in' modifier for B2Circle parameters#84

Merged
ikpil merged 1 commit intomainfrom
pr/in-params
Feb 28, 2026
Merged

Refactor: Use 'in' modifier for B2Circle parameters#84
ikpil merged 1 commit intomainfrom
pr/in-params

Conversation

@ikpil
Copy link
Owner

@ikpil ikpil commented Feb 28, 2026

  • Changed B2Circle struct parameters from ref to the in modifier in collision functions (b2CollideCircles, b2CollidePolygonAndCircle, etc.) and b2Shape_SetCircle.
  • This is a C# performance optimization that passes the struct by read-only reference, avoiding unnecessary copies.
  • Updated all call sites in the core library and samples to match the new, more efficient method signatures.

- Changed `B2Circle` struct parameters from `ref` to the `in` modifier in collision functions (`b2CollideCircles`, `b2CollidePolygonAndCircle`, etc.) and `b2Shape_SetCircle`.
- This is a C# performance optimization that passes the struct by read-only reference, avoiding unnecessary copies.
- Updated all call sites in the core library and samples to match the new, more efficient method signatures.
@ikpil ikpil merged commit 9579bb9 into main Feb 28, 2026
10 checks passed
@ikpil ikpil mentioned this pull request Feb 28, 2026
@ikpil ikpil deleted the pr/in-params branch February 28, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant