mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
Simplify with code coerceAtLeast(0)`
This commit is contained in:
+1
-3
@@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user