Optimize refreshData in RoutingSettingActivity (#3775)
Optimized the refreshData method by clearing the existing rulesets list and adding the new items to avoid unnecessary reallocation and improve memory management.
This commit is contained in:
@@ -156,7 +156,9 @@ class RoutingSettingActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
fun refreshData() {
|
||||
rulesets = MmkvManager.decodeRoutingRulesets() ?: mutableListOf()
|
||||
rulesets.clear()
|
||||
rulesets.addAll(MmkvManager.decodeRoutingRulesets() ?: mutableListOf())
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user