From af12dedbf8a786563c41a23500d3a1769ee37488 Mon Sep 17 00:00:00 2001 From: bswe Date: Sun, 13 Oct 2019 11:14:17 -0700 Subject: [PATCH] [fenix] Reformatting to simplify use of .any construct as suggested in review --- .../fenix/components/PrivateShortcutCreateManager.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/PrivateShortcutCreateManager.kt b/app/src/main/java/org/mozilla/fenix/components/PrivateShortcutCreateManager.kt index 7ba6aeea54..3e5939e793 100644 --- a/app/src/main/java/org/mozilla/fenix/components/PrivateShortcutCreateManager.kt +++ b/app/src/main/java/org/mozilla/fenix/components/PrivateShortcutCreateManager.kt @@ -26,11 +26,10 @@ object PrivateShortcutCreateManager { fun doesPrivateBrowsingPinnedShortcutExist(context: Context): Boolean { return if (SDK_INT >= Build.VERSION_CODES.N_MR1) { val pinnedShortcuts = context.getSystemService(ShortcutManager::class.java).pinnedShortcuts - if (pinnedShortcuts.any { - it.intent?.extras?.getString(HomeActivity.OPEN_TO_SEARCH) == - StartSearchIntentProcessor.PRIVATE_BROWSING_PINNED_SHORTCUT }) - return true - false + pinnedShortcuts.any { + it.intent?.extras?.getString(HomeActivity.OPEN_TO_SEARCH) == + StartSearchIntentProcessor.PRIVATE_BROWSING_PINNED_SHORTCUT + } } else false }