diff --git a/src/DotRecast.Core/Buffers/RcRentedArray.cs b/src/DotRecast.Core/Buffers/RcRentedArray.cs index e7809f6..208b951 100644 --- a/src/DotRecast.Core/Buffers/RcRentedArray.cs +++ b/src/DotRecast.Core/Buffers/RcRentedArray.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Buffers; using System.Runtime.CompilerServices; diff --git a/src/DotRecast.Detour/DtNavMeshQuery.cs b/src/DotRecast.Detour/DtNavMeshQuery.cs index 4a1ce9f..7200a57 100644 --- a/src/DotRecast.Detour/DtNavMeshQuery.cs +++ b/src/DotRecast.Detour/DtNavMeshQuery.cs @@ -607,7 +607,8 @@ namespace DotRecast.Detour { const int batchSize = 32; Span polyRefs = stackalloc long[batchSize]; - DtPoly[] polys = new DtPoly[batchSize]; + using RcRentedArray polysRent = RcRentedArray.Rent(batchSize); + Span polys = polysRent.AsSpan(); int n = 0; if (tile.data.bvTree != null)