mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-02 21:09:30 +01:00
ktlint
This commit is contained in:
parent
63b3def667
commit
d9386cd61f
@ -56,12 +56,13 @@ class EventMatchCondition(
|
||||
if (wordsOnly) {
|
||||
value.caseInsensitiveFind(pattern)
|
||||
} else {
|
||||
val modPattern = if (pattern.hasSpecialGlobChar())
|
||||
val modPattern = if (pattern.hasSpecialGlobChar()) {
|
||||
// Regex.containsMatchIn() is way faster without leading and trailing
|
||||
// stars, that don't make any difference for the evaluation result
|
||||
pattern.removePrefix("*").removeSuffix("*").simpleGlobToRegExp()
|
||||
else
|
||||
} else {
|
||||
pattern.simpleGlobToRegExp()
|
||||
}
|
||||
val regex = Regex(modPattern, RegexOption.DOT_MATCHES_ALL)
|
||||
regex.containsMatchIn(value)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user