Skip to content

Commit

Permalink
For mozilla-mobile#15279: remove redundant lazy wrapper from storage …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
mcomella committed Oct 31, 2020
1 parent 1b96b0f commit 074897b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/org/mozilla/fenix/components/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 074897b

Please sign in to comment.