From 090650485f46f4a11eef22086d0976e399b5152d Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Fri, 30 Oct 2020 12:53:10 -0700 Subject: [PATCH] For #15279: remove redundant lazy wrapper from storage APIs. They're currently lazy { lazy { value } }. Accessing `lazy.value` directly allows us to make it lazy { value }. This should be more performant and prevents us from double-counting these components. --- app/src/main/java/org/mozilla/fenix/components/Core.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/Core.kt b/app/src/main/java/org/mozilla/fenix/components/Core.kt index 687289338..e27f0bc5f 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -303,9 +303,9 @@ class Core( val lazyRemoteTabsStorage = lazyMonitored { RemoteTabsStorage() } // For most other application code (non-startup), these wrappers are perfectly fine and more ergonomic. - val historyStorage by lazyMonitored { lazyHistoryStorage.value } - val bookmarksStorage by lazyMonitored { lazyBookmarksStorage.value } - val passwordsStorage by lazyMonitored { lazyPasswordsStorage.value } + val historyStorage: PlacesHistoryStorage get() = lazyHistoryStorage.value + val bookmarksStorage: PlacesBookmarksStorage get() = lazyBookmarksStorage.value + val passwordsStorage: SyncableLoginsStorage get() = lazyPasswordsStorage.value val tabCollectionStorage by lazyMonitored { TabCollectionStorage(