mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Cleanup
This commit is contained in:
parent
66aa9cd888
commit
0cd728222e
1 changed files with 3 additions and 2 deletions
|
@ -155,6 +155,7 @@ class TimelineEventController @Inject constructor(private val dateFormatter: Vec
|
|||
synchronized(modelCache) {
|
||||
assertUpdateCallbacksAllowed()
|
||||
(position until (position + count)).forEach {
|
||||
// Invalidate cache
|
||||
modelCache[it] = null
|
||||
}
|
||||
requestModelBuild()
|
||||
|
@ -173,7 +174,7 @@ class TimelineEventController @Inject constructor(private val dateFormatter: Vec
|
|||
override fun onInserted(position: Int, count: Int) {
|
||||
synchronized(modelCache) {
|
||||
assertUpdateCallbacksAllowed()
|
||||
(0 until count).forEach {
|
||||
repeat(count) {
|
||||
modelCache.add(position, null)
|
||||
}
|
||||
requestModelBuild()
|
||||
|
@ -183,7 +184,7 @@ class TimelineEventController @Inject constructor(private val dateFormatter: Vec
|
|||
override fun onRemoved(position: Int, count: Int) {
|
||||
synchronized(modelCache) {
|
||||
assertUpdateCallbacksAllowed()
|
||||
(0 until count).forEach {
|
||||
repeat(count) {
|
||||
modelCache.removeAt(position)
|
||||
}
|
||||
requestModelBuild()
|
||||
|
|
Loading…
Reference in a new issue