Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce disk hits when accessing shared preferences.
While the same instance of SharedPreferences is returned each time, in order to get it, the system has to do a file check each time it's with a new context. We can safely cache the instance instead of paying that file check each time and pay it only once.
- Loading branch information
1 parent
819f7a1
commit 9c914ab
Showing
2 changed files
with
40 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters