aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang/kau/permissions
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-10-19 22:30:16 -0700
committerAllan Wang <me@allanwang.ca>2019-10-19 22:31:14 -0700
commit7007e61879bf33c09115b5d8bc16f27af2731045 (patch)
tree19bc5e07f16ce1b6b9d13c711fed5160e25bc3ad /core/src/main/kotlin/ca/allanwang/kau/permissions
parent63f920c3257e955da1ef63c91f8b5e2de5478e55 (diff)
downloadkau-7007e61879bf33c09115b5d8bc16f27af2731045.tar.gz
kau-7007e61879bf33c09115b5d8bc16f27af2731045.tar.bz2
kau-7007e61879bf33c09115b5d8bc16f27af2731045.zip
Convert java math to kotlin math
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/permissions')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt
index b549523..dfe98cb 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt
@@ -27,6 +27,7 @@ import ca.allanwang.kau.utils.buildIsMarshmallowAndUp
import ca.allanwang.kau.utils.hasPermission
import ca.allanwang.kau.utils.toast
import java.lang.ref.WeakReference
+import kotlin.math.min
/**
* Created by Allan Wang on 2017-07-03.
@@ -97,7 +98,7 @@ internal object PermissionManager {
*/
fun onRequestPermissionsResult(context: Context, permissions: Array<out String>, grantResults: IntArray) {
KL.i { "On permission result: pending ${pendingResults.size}" }
- val count = Math.min(permissions.size, grantResults.size)
+ val count = min(permissions.size, grantResults.size)
pendingResults.kauRemoveIf {
val action = it.get()
action == null || (0 until count).any { i -> action.onResult(permissions[i], grantResults[i]) }