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