mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 23:06:24 +02:00
Fixes reply level calculation caching.
This commit is contained in:
@@ -118,11 +118,17 @@ object ThreadLevelCalculator {
|
|||||||
if (
|
if (
|
||||||
note.event is RepostEvent || note.event is GenericRepostEvent || replyTo == null || replyTo.isEmpty()
|
note.event is RepostEvent || note.event is GenericRepostEvent || replyTo == null || replyTo.isEmpty()
|
||||||
) {
|
) {
|
||||||
|
cachedLevels[note] = 0
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return replyTo.maxOf {
|
val thisLevel =
|
||||||
cachedLevels[it] ?: replyLevel(it, cachedLevels).apply { cachedLevels.put(it, this) }
|
replyTo.maxOf {
|
||||||
} + 1
|
cachedLevels[it] ?: replyLevel(it, cachedLevels)
|
||||||
|
} + 1
|
||||||
|
|
||||||
|
cachedLevels[note] = thisLevel
|
||||||
|
|
||||||
|
return thisLevel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user