Simplify with code coerceAtLeast(0)`
This commit is contained in:
@@ -206,8 +206,6 @@ class MediaViewerPresenter @AssistedInject constructor(
|
||||
}
|
||||
return data.indexOfFirst {
|
||||
(it as? MediaViewerPageData.MediaViewerData)?.eventId == eventId
|
||||
}
|
||||
.takeIf { it != -1 }
|
||||
?: 0
|
||||
}.coerceAtLeast(0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user