Skip to content

Conversation

@dkhawk
Copy link
Contributor

@dkhawk dkhawk commented Sep 2, 2025

Refactored the PolyUtil.simplify function to not mutate its inputs and to be more idiomatic Kotlin.

  • The function no longer mutates the input list.
  • Extracted the core Douglas-Peucker algorithm into a private helper function.
  • Replaced java.util.Stack with ArrayDeque.
  • Improved variable scoping.

Refactored the `simplify` function to be more idiomatic Kotlin.

- Extracted the core Douglas-Peucker algorithm into a private helper function.
- Replaced `java.util.Stack` with `ArrayDeque`.
- Improved variable scoping.
- The function no longer modifies the input list.
@dkhawk dkhawk requested a review from kikoso September 2, 2025 23:21
@googlemaps-bot
Copy link
Contributor

googlemaps-bot commented Sep 2, 2025

Code Coverage

Overall Project 40.16% -0.04% 🍏
Files changed 95.03% 🍏

File Coverage
PolyUtil.kt 97.88% -0.64% 🍏

Copy link
Collaborator

@kikoso kikoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dkhawk dkhawk merged commit 2f2374d into main Sep 3, 2025
8 checks passed
@dkhawk dkhawk deleted the feature/refactor-simplify branch September 3, 2025 13:43
googlemaps-bot pushed a commit that referenced this pull request Sep 3, 2025
## [3.16.1](v3.16.0...v3.16.1) (2025-09-03)

### Bug Fixes

* **PolyUtil:** Refactored the `PolyUtil.simplify` function to not mutate its inputs ([#1585](#1585)) ([2f2374d](2f2374d))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 3.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants