Simplify with code coerceAtLeast(0)`

This commit is contained in:
Benoit Marty 2025-01-23 14:57:05 +01:00
parent dff9005a70
commit 54182b0d8e

View file

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