Rename enabling old behavior property and make it cached in a field

Mention the property name in the note about conversion to set.

#KT-45438
This commit is contained in:
Ilya Gorbunov
2021-09-01 18:21:14 +03:00
parent 94b371af5b
commit 11314a5c4e
5 changed files with 39 additions and 22 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -124,4 +124,11 @@ internal actual inline fun checkCountOverflow(count: Int): Int {
}
internal actual fun brittleContainsOptimizationEnabled(): Boolean = System.getProperty("kotlin.collections.removing.legacymode").toBoolean()
@Suppress("NOTHING_TO_INLINE")
internal actual inline fun brittleContainsOptimizationEnabled(): Boolean = CollectionSystemProperties.brittleContainsOptimizationEnabled
internal object CollectionSystemProperties {
@JvmField
internal val brittleContainsOptimizationEnabled: Boolean =
System.getProperty("kotlin.collections.convert_arg_to_set_in_removeAll")?.toBoolean() ?: false
}