Skip to content

Commit

Permalink
A more idiomatic Kotlin way
Browse files Browse the repository at this point in the history
  • Loading branch information
ElJaviLuki committed May 26, 2023
1 parent 5b8d622 commit d3cc130
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/com/grindrplus/Hooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ object Hooks {
GApp.api.PhrasesRestService_.getSavedPhrases -> {
val phrases =
Hooker.sharedPref.getStringSet("phrases", emptySet())!!
.map { id ->
.associateWith { id ->
val text = Hooker.sharedPref.getString(
"phrase_${id}_text",
""
Expand All @@ -952,14 +952,13 @@ object Hooks {
"phrase_${id}_frequency",
0
)
id to constructor_Phrase.newInstance(
constructor_Phrase.newInstance(
id,
text,
timestamp,
frequency
)
}
.toMap()
val phrasesResponse =
constructor_PhrasesResponse.newInstance(phrases)
createSuccessResult.invoke(null, phrasesResponse)
Expand Down

0 comments on commit d3cc130

Please sign in to comment.