mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[collab] do not create new set when not needed
GitOrigin-RevId: 0bb2b7cd06778faf2bf499f267a057a3066498a0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
703f13f1d9
commit
de3ff8eea8
@@ -2,8 +2,10 @@
|
||||
package com.intellij.collaboration.util
|
||||
|
||||
class CollectionDelta<out T>(oldCollection: Collection<T>, val newCollection: Collection<T>) {
|
||||
val newItems: Collection<T> = newCollection - oldCollection.toSet()
|
||||
val removedItems: Collection<T> = oldCollection - newCollection.toSet()
|
||||
val newItems: Collection<T> = newCollection - oldCollection.asSet()
|
||||
val removedItems: Collection<T> = oldCollection - newCollection.asSet()
|
||||
|
||||
private fun <T> Collection<T>.asSet() = ((this as? Set<T>) ?: toSet())
|
||||
|
||||
val isEmpty = newItems.isEmpty() && removedItems.isEmpty()
|
||||
}
|
||||
Reference in New Issue
Block a user