[Commonizer] Use more compact interner based on THashSet
This commit is contained in:
@@ -5,8 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.descriptors.commonizer.utils
|
package org.jetbrains.kotlin.descriptors.commonizer.utils
|
||||||
|
|
||||||
class Interner<T : Any> {
|
import com.intellij.util.containers.OpenTHashSet
|
||||||
private val pool = com.intellij.util.containers.Interner.createWeakInterner<T>()
|
|
||||||
|
|
||||||
fun intern(value: T): T = pool.intern(value)
|
class Interner<T : Any> {
|
||||||
|
private val pool = OpenTHashSet<T>()
|
||||||
|
|
||||||
|
fun intern(value: T): T = pool.getOrAdd(value)
|
||||||
}
|
}
|
||||||
|
|||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.descriptors.commonizer.utils
|
|
||||||
|
|
||||||
import com.intellij.util.containers.WeakInterner
|
|
||||||
|
|
||||||
class Interner<T : Any> {
|
|
||||||
private val pool = WeakInterner<T>()
|
|
||||||
|
|
||||||
fun intern(value: T): T = pool.intern(value)
|
|
||||||
}
|
|
||||||
@@ -166,6 +166,7 @@
|
|||||||
-keep class com.intellij.util.containers.hash.EqualityPolicy { *; }
|
-keep class com.intellij.util.containers.hash.EqualityPolicy { *; }
|
||||||
-keep class com.intellij.util.containers.hash.EqualityPolicy.* { *; }
|
-keep class com.intellij.util.containers.hash.EqualityPolicy.* { *; }
|
||||||
-keep class com.intellij.util.containers.Interner { *; }
|
-keep class com.intellij.util.containers.Interner { *; }
|
||||||
|
-keep class com.intellij.util.containers.OpenTHashSet { *; }
|
||||||
-keep class gnu.trove.TIntHashSet { *; }
|
-keep class gnu.trove.TIntHashSet { *; }
|
||||||
-keep class gnu.trove.TIntIterator { *; }
|
-keep class gnu.trove.TIntIterator { *; }
|
||||||
-keep class org.iq80.snappy.SlowMemory { *; }
|
-keep class org.iq80.snappy.SlowMemory { *; }
|
||||||
|
|||||||
Reference in New Issue
Block a user