Skip to content

Commit 28cc603

Browse files
committed
SharedPreferencesUtils.kt: Refactor setStringPref to use Kotlin's apply extension function for SharedPreferences
1 parent a843920 commit 28cc603

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/com/addev/listaspam/util/SharedPreferencesUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private fun getStringPref(context: Context, key: String): String? =
1717
getPrefs(context).getString(key, null)
1818

1919
private fun setStringPref(context: Context, key: String, value: String) {
20-
getPrefs(context).edit().putString(key, value).apply()
20+
getPrefs(context).edit { putString(key, value) }
2121
}
2222

2323
fun isBlockingEnabled(context: Context): Boolean =

0 commit comments

Comments
 (0)