mapbox / mapbox/mapbox-navigation-ios
Refactoring code to avoid manual index comparison.
Open
Nobody has claimed this yet.
jira-sync-complete
topic: stability
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
There're multiple places in our code repo that are using the `endIndex` or `count` for the out-of-bound check and calculation. To avoid this issue, it should be refactored to `indices.contains(_:)` to avoid the manual comparison.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for out-of-bounds checks and calculations using `endIndex` or `count`, then identify the applicable occurrences across the codebase. Refactor those checks to use `indices.contains(_:)` and run the existing test suite to confirm navigation behavior is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100