Skip to content

Commit

Permalink
♻️ :: 변수로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
lyutvs committed May 25, 2023
1 parent ae95f26 commit a3db1bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ class Category(
val defaultActivated: Boolean,

val topic: String,
) {
fun getTopicSubStringBy_(): String {
return topic.substringBefore("_")
}
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class SettingApiImpl(
val activatedCategories = settingList.mapNotNull { setting ->
val category = categoryMap[setting.notificationCategoryId]
category?.let {
SettingElement(it.getTopicSubStringBy_(), setting.isActivated)
val topicSubStringByUnderscore = it.topic.substringBefore("_")
SettingElement(topicSubStringByUnderscore, setting.isActivated)
}
}.distinctBy { it.topic }

Expand Down

0 comments on commit a3db1bb

Please sign in to comment.