Move lambdas outside of parentheses

This commit is contained in:
Moez Bhatti
2018-06-21 08:57:08 -04:00
parent 89b43adfab
commit 9b624d33d5
18 changed files with 96 additions and 96 deletions
@@ -35,10 +35,10 @@ fun Cursor.forEach(closeOnComplete: Boolean = true, method: (Cursor) -> Unit = {
}
fun <T> Cursor.map(map: (Cursor) -> T): List<T> {
return List(count, { position ->
return List(count) { position ->
moveToPosition(position)
map(this)
})
}
}
fun <T> Cursor.mapWhile(map: (Cursor) -> T, predicate: (T) -> Boolean): ArrayList<T> {
@@ -40,10 +40,10 @@ class RatingManagerImpl @Inject constructor(
override val shouldShowRating = Observables.combineLatest(
sessions.asObservable(),
rated.asObservable(),
dismissed.asObservable(), { sessions, rated, dismissed ->
dismissed.asObservable()) { sessions, rated, dismissed ->
sessions > SESSION_THRESHOLD && !rated && !dismissed
})
}
override fun addSession() {
sessions.set(sessions.get() + 1)
@@ -40,7 +40,7 @@ class DefaultSmsChangedReceiver : BroadcastReceiver() {
if (intent.getBooleanExtra(Telephony.Sms.Intents.EXTRA_IS_DEFAULT_SMS_APP, false)) {
val pendingResult = goAsync()
syncMessages.execute(Unit, { pendingResult.finish() })
syncMessages.execute(Unit) { pendingResult.finish() }
}
}
@@ -37,7 +37,7 @@ class SmsReceiver : BroadcastReceiver() {
val subId = intent.extras?.getInt("subscription", -1) ?: -1
val pendingResult = goAsync()
receiveMessage.execute(ReceiveSms.Params(subId, messages), { pendingResult.finish() })
receiveMessage.execute(ReceiveSms.Params(subId, messages)) { pendingResult.finish() }
}
}