mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 19:06:34 +02:00
Refactors to use native contains instead of custom lambdas on Ammolite's Filter
This commit is contained in:
@@ -32,9 +32,9 @@ object FilterMatcher {
|
|||||||
since: Long? = null,
|
since: Long? = null,
|
||||||
until: Long? = null,
|
until: Long? = null,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
if (ids?.any { event.id == it } == false) return false
|
if (ids?.contains(event.id) == false) return false
|
||||||
if (kinds?.any { event.kind == it } == false) return false
|
if (kinds?.contains(event.kind) == false) return false
|
||||||
if (authors?.any { event.pubKey == it } == false) return false
|
if (authors?.contains(event.pubKey) == false) return false
|
||||||
tags?.forEach { tag ->
|
tags?.forEach { tag ->
|
||||||
if (!event.tags.any { it.first() == tag.key && it[1] in tag.value }) return false
|
if (!event.tags.any { it.first() == tag.key && it[1] in tag.value }) return false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user