mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 19:58:57 +03:00
ktlint
This commit is contained in:
parent
63b3def667
commit
d9386cd61f
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue