Revert "Restore default parameter values in JS collection constructors"
This reverts commit 0f972f24
This commit is contained in:
committed by
Space
parent
261d0c2783
commit
08eaac7e56
@@ -24,8 +24,7 @@ public actual open class ArrayList<E> internal constructor(private var array: Ar
|
||||
* Creates an empty [ArrayList].
|
||||
* @param initialCapacity initial capacity (ignored)
|
||||
*/
|
||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||
public actual constructor(initialCapacity: Int = 0) : this(emptyArray()) {}
|
||||
public actual constructor(initialCapacity: Int) : this(emptyArray()) {}
|
||||
|
||||
/**
|
||||
* Creates an [ArrayList] filled from the [elements] collection.
|
||||
|
||||
@@ -69,8 +69,7 @@ public actual open class HashMap<K, V> : AbstractMutableMap<K, V>, MutableMap<K,
|
||||
*
|
||||
* @throws IllegalArgumentException if the initial capacity or load factor are negative
|
||||
*/
|
||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float = 0.0f) : this() {
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float) : this() {
|
||||
// This implementation of HashMap has no need of load factors or capacities.
|
||||
require(initialCapacity >= 0) { "Negative initial capacity: $initialCapacity" }
|
||||
require(loadFactor >= 0) { "Non-positive load factor: $loadFactor" }
|
||||
|
||||
@@ -41,8 +41,7 @@ public actual open class HashSet<E> : AbstractMutableSet<E>, MutableSet<E> {
|
||||
*
|
||||
* @throws IllegalArgumentException if the initial capacity or load factor are negative
|
||||
*/
|
||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float = 0.0f) {
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float) {
|
||||
map = HashMap<E, Any>(initialCapacity, loadFactor)
|
||||
}
|
||||
|
||||
|
||||
@@ -186,8 +186,7 @@ public actual open class LinkedHashMap<K, V> : HashMap<K, V>, MutableMap<K, V> {
|
||||
*
|
||||
* @throws IllegalArgumentException if the initial capacity or load factor are negative
|
||||
*/
|
||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float = 0.0f) : super(initialCapacity, loadFactor) {
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float) : super(initialCapacity, loadFactor) {
|
||||
map = HashMap<K, ChainEntry<K, V>>()
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@ public actual open class LinkedHashSet<E> : HashSet<E>, MutableSet<E> {
|
||||
*
|
||||
* @throws IllegalArgumentException if the initial capacity or load factor are negative
|
||||
*/
|
||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float = 0.0f) : super(LinkedHashMap<E, Any>(initialCapacity, loadFactor))
|
||||
actual constructor(initialCapacity: Int, loadFactor: Float) : super(LinkedHashMap<E, Any>(initialCapacity, loadFactor))
|
||||
|
||||
actual constructor(initialCapacity: Int) : this(initialCapacity, 0.0f)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user