mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[plugins] IJPL-202170 use weak interner for ModuleIds
GitOrigin-RevId: 1122527cf2d1c0ea252d72f6b38588c2c8368f3a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
792bce9178
commit
6be741934a
@@ -2,6 +2,7 @@
|
||||
package com.intellij.ide.plugins
|
||||
|
||||
import com.intellij.openapi.util.IntellijInternalApi
|
||||
import com.intellij.util.containers.Interner
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
/**
|
||||
@@ -10,4 +11,11 @@ import org.jetbrains.annotations.ApiStatus
|
||||
@JvmInline
|
||||
@ApiStatus.Internal
|
||||
@IntellijInternalApi
|
||||
value class ModuleId(val id: String)
|
||||
value class ModuleId private constructor(val id: String){
|
||||
companion object {
|
||||
// ModuleId can be either boxed or unboxed, so only interning of value matters
|
||||
private val interner = Interner.createWeakInterner<String>()
|
||||
|
||||
operator fun invoke(id: String): ModuleId = ModuleId(interner.intern(id))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user