Skip to content

Change Encode parameter from ReadOnlySpan<TValue> to IEnumerable<TValue>#236

Merged
petesramek merged 3 commits intoextend-polylinealgorithm-multi-dimensional-supportfrom
copilot/change-encode-method-parameter
Apr 13, 2026
Merged

Change Encode parameter from ReadOnlySpan<TValue> to IEnumerable<TValue>#236
petesramek merged 3 commits intoextend-polylinealgorithm-multi-dimensional-supportfrom
copilot/change-encode-method-parameter

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 13, 2026

  • Understand current PolylineEncoder.cs structure
  • Replace IReadOnlyList<TValue> materialization with direct foreach + anyItemProcessed flag
  • Replace pre-allocated char buffer with grow-on-demand (stackalloc char[StackAllocLimit] → double-and-rent from ArrayPool on overflow)
  • Replace heap long[] scratch arrays with stackalloc long[MaxStackWidth] sliced to [..width]
  • Factor shared encode logic into private EncodeCore (both overloads delegate to it)
  • Update SeedPrevious to accept Span<long> instead of long[]
  • Remove GetMaxBufferLength
  • Address code review: rename hasItemsanyItemProcessed for clarity
  • Build clean (0 new warnings); all 225 tests pass; 0 CodeQL alerts

@petesramek petesramek marked this pull request as ready for review April 13, 2026 17:24
@petesramek petesramek merged commit a148b15 into extend-polylinealgorithm-multi-dimensional-support Apr 13, 2026
3 of 4 checks passed
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.

2 participants