Adding helper method to avoid adding comment

This commit is contained in:
Maxime NATUREL 2022-04-29 13:37:14 +02:00
parent 61b1e84e61
commit f9220e4185

View File

@ -82,9 +82,10 @@ internal class DefaultLiveLocationAggregationProcessor @Inject constructor() : L
?.getBestTimestampAsMilliseconds()
?: 0
if (updatedLocationTimestamp > currentLocationTimestamp) {
// only take location if it is more recent
if (updatedLocationTimestamp.isMoreRecentThan(currentLocationTimestamp)) {
aggregatedSummary.lastLocationContent = ContentMapper.map(content.toContent())
}
}
private fun Long.isMoreRecentThan(timestamp: Long) = this > timestamp
}