From f23b5b1c85fecf028c8fa378a3f8f9865ebfa79b Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Tue, 26 May 2020 20:17:33 +0300 Subject: [PATCH] [Workspace Model] Revert isEmpty method for EntityFamily GitOrigin-RevId: 9c175e433f2a8eae0706a06ae126a5611a199239 --- platform/workspaceModel-core/src/pstorage/EntityFamily.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/platform/workspaceModel-core/src/pstorage/EntityFamily.kt b/platform/workspaceModel-core/src/pstorage/EntityFamily.kt index 9ed81b389635..e16edd64e3c6 100644 --- a/platform/workspaceModel-core/src/pstorage/EntityFamily.kt +++ b/platform/workspaceModel-core/src/pstorage/EntityFamily.kt @@ -14,8 +14,6 @@ internal class ImmutableEntityFamily( override fun size(): Int = entities.size - emptySlotsSize - override fun isEmpty(): Boolean = entities.isEmpty() || entities.size - emptySlotsSize == 0 - inline fun assertConsistency(entityAssertion: (PEntityData) -> Unit = {}) { var emptySlotsCounter = 0 @@ -110,8 +108,6 @@ internal class MutableEntityFamily( override fun size(): Int = entities.size - amountOfGapsInEntities - override fun isEmpty(): Boolean = entities.isEmpty() || entities.size - amountOfGapsInEntities == 0 - /** This method should always be called before any modification */ private fun startWrite() { if (!freezed) return @@ -141,6 +137,6 @@ internal sealed class EntityFamily { operator fun get(idx: Int) = entities.getOrNull(idx) fun exists(id: Int) = get(id) != null fun all() = entities.asSequence().filterNotNull() + fun isEmpty(): Boolean = entities.isEmpty() abstract fun size(): Int - abstract fun isEmpty(): Boolean } \ No newline at end of file