Optimize Name hashCode

This commit is contained in:
Alexander Nozik 2022-08-23 10:58:09 +03:00
parent 0cc4dc0db7
commit 5406a6a64c
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357

View File

@ -132,7 +132,9 @@ public fun Meta.getIndexed(name: Name): Map<String?, Meta> {
else -> this[name.cutLast()] ?: return emptyMap()
}
val (body, index) = name.lastOrNull()!!
val lastName = name.lastOrNull()!!
val body = lastName.body
val index = lastName.index
return if (index == null) {
root.items
.filter { it.key.body == body }