Simplify with code coerceAtLeast(0)`

This commit is contained in:
Benoit Marty 2025-01-23 14:57:05 +01:00
parent b967c877a6
commit fae1c0800d

View file

@ -206,8 +206,6 @@ class MediaViewerPresenter @AssistedInject constructor(
} }
return data.indexOfFirst { return data.indexOfFirst {
(it as? MediaViewerPageData.MediaViewerData)?.eventId == eventId (it as? MediaViewerPageData.MediaViewerData)?.eventId == eventId
} }.coerceAtLeast(0)
.takeIf { it != -1 }
?: 0
} }
} }