@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmName("SetsKt") package kotlin.collections internal object EmptySet : Set, java.io.Serializable { private const val serialVersionUID: Long = 3406603774387020532 override fun equals(other: Any?): Boolean = other is Set<*> && other.isEmpty() override fun hashCode(): Int = 0 override fun toString(): String = "[]" override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(element: Nothing): Boolean = false override fun containsAll(elements: Collection): Boolean = elements.isEmpty() override fun iterator(): Iterator = EmptyIterator private fun readResolve(): Any = EmptySet } public fun emptySet(): Set = EmptySet public fun setOf(vararg elements: T): Set = if (elements.size > 0) elements.toSet() else emptySet() public inline fun setOf(): Set = emptySet() public inline fun mutableSetOf(): MutableSet = LinkedHashSet() public fun mutableSetOf(vararg elements: T): MutableSet = elements.toCollection(LinkedHashSet(mapCapacity(elements.size))) public inline fun hashSetOf(): HashSet = kotlin.UnsupportedOperationException("This is intrinsic") public fun hashSetOf(vararg elements: T): HashSet = kotlin.UnsupportedOperationException("This is intrinsic") internal fun Set.optimizeReadOnlySet() = when (size) { 0 -> emptySet() 1 -> setOf(iterator().next()) else -> this }