Switch to non-deprecated stdlib methods (#990)

min and max were deprecated in favor of minOrNull and maxOrNull respectively to match their names to the typical
naming format used by stdlib methods with nullable return types

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-07-31 13:06:54 +05:30 committed by GitHub
parent cea9f4b942
commit dc4a9cadc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -271,7 +271,7 @@ class FormField(
}
infix fun directlyPrecedes(that: Iterable<FormField>): Boolean {
val firstIndex = that.map { it.index }.min() ?: return false
val firstIndex = that.map { it.index }.minOrNull() ?: return false
return index == firstIndex - 1
}
@ -280,7 +280,7 @@ class FormField(
}
infix fun directlyFollows(that: Iterable<FormField>): Boolean {
val lastIndex = that.map { it.index }.max() ?: return false
val lastIndex = that.map { it.index }.maxOrNull() ?: return false
return index == lastIndex + 1
}