Skip to content

Commit

Permalink
Add constant DISPLACEMENT_LOCATION_COUNT.
Browse files Browse the repository at this point in the history
  • Loading branch information
voussoir committed Mar 27, 2023
1 parent a86d1f4 commit 36f15bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/net/voussoir/trkpt/TrackerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TrackerService: Service()
var lastCommit: Long = 0
var location_min_time_ms: Long = 0
private val RECENT_TRKPT_COUNT = 7200
private val DISPLACEMENT_LOCATION_COUNT = 5
lateinit var recent_displacement_locations: Deque<Location>
lateinit var recent_trackpoints_for_mapview: MutableList<GeoPoint>
var bound: Boolean = false
Expand Down Expand Up @@ -282,7 +283,7 @@ class TrackerService: Service()
}

recent_displacement_locations.add(location)
while (recent_displacement_locations.size > 5)
while (recent_displacement_locations.size > DISPLACEMENT_LOCATION_COUNT)
{
recent_displacement_locations.removeFirst()
}
Expand Down

0 comments on commit 36f15bf

Please sign in to comment.