Skip to content

Commit

Permalink
perf: rule index
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Mar 4, 2024
1 parent 81ced23 commit 03bb539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/li/songe/gkd/data/ResolvedRule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sealed class ResolvedRule(
val rawSubs = g.subscription
val config = g.config
val key = rule.key
val index = group.rules.indexOf(rule)
val index = group.rules.indexOfFirst { r -> r === rule }
private val preKeys = (rule.preKeys ?: emptyList()).toSet()
private val matches = rule.matches?.map { s -> Selector.parse(s) } ?: emptyList()
private val excludeMatches = (rule.excludeMatches ?: emptyList()).map { s -> Selector.parse(s) }
Expand Down

0 comments on commit 03bb539

Please sign in to comment.