From ae1dde1993af201e5c81124fb3d917dd70e93763 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Mon, 26 Apr 2021 15:39:20 +0200 Subject: [PATCH] Use `isNotEmpty` instead of `size > 0` --- android/src/main/java/com/mrousavy/camera/CameraViewModule.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt b/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt index f32570d..cda4469 100644 --- a/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt +++ b/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt @@ -289,7 +289,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase val currentRequestCode = RequestCode++ val listener = PermissionListener { requestCode: Int, _: Array, grantResults: IntArray -> if (requestCode == currentRequestCode) { - val permissionStatus = if (grantResults.size > 0) grantResults[0] else PackageManager.PERMISSION_DENIED + val permissionStatus = if (grantResults.isNotEmpty()) grantResults[0] else PackageManager.PERMISSION_DENIED promise.resolve(parsePermissionStatus(permissionStatus)) return@PermissionListener true } @@ -308,7 +308,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase val currentRequestCode = RequestCode++ val listener = PermissionListener { requestCode: Int, _: Array, grantResults: IntArray -> if (requestCode == currentRequestCode) { - val permissionStatus = if (grantResults.size > 0) grantResults[0] else PackageManager.PERMISSION_DENIED + val permissionStatus = if (grantResults.isNotEmpty()) grantResults[0] else PackageManager.PERMISSION_DENIED promise.resolve(parsePermissionStatus(permissionStatus)) return@PermissionListener true }