diff --git a/weak/src/commonMain/kotlin/algorithms/EmptyWeakRef.kt b/weak/src/commonMain/kotlin/algorithms/EmptyWeakRef.kt index 2ccb9aa..f8f75da 100644 --- a/weak/src/commonMain/kotlin/algorithms/EmptyWeakRef.kt +++ b/weak/src/commonMain/kotlin/algorithms/EmptyWeakRef.kt @@ -16,7 +16,6 @@ package opensavvy.pedestal.weak.algorithms -import opensavvy.pedestal.weak.ExperimentalWeakApi import opensavvy.pedestal.weak.WeakRef private object EmptyWeakRefImpl : WeakRef { @@ -31,14 +30,5 @@ private object EmptyWeakRefImpl : WeakRef { * It acts as if there was a value, but it was immediately freed. */ @Suppress("FunctionName") -@ExperimentalWeakApi -fun EmptyWeakRef(): WeakRef = - EmptyWeakRefImpl - -/** - * A [WeakRef] implementation that immediately frees its [value]. - */ -@Suppress("UNUSED_PARAMETER", "FunctionName") -@ExperimentalWeakApi -fun EmptyWeakRef(value: T): WeakRef = +internal fun EmptyWeakRef(): WeakRef = EmptyWeakRefImpl diff --git a/weak/src/jsMain/kotlin/WeakRef.js.kt b/weak/src/jsMain/kotlin/WeakRef.js.kt index a158f16..0346bc3 100644 --- a/weak/src/jsMain/kotlin/WeakRef.js.kt +++ b/weak/src/jsMain/kotlin/WeakRef.js.kt @@ -39,7 +39,7 @@ private class JsWeakRef( */ @ExperimentalWeakApi actual fun WeakRef(value: T): WeakRef = - if (value == null) EmptyWeakRef(value) + if (value == null) EmptyWeakRef() else JsWeakRef(value) /** diff --git a/weak/src/nativeMain/kotlin/WeakRef.native.kt b/weak/src/nativeMain/kotlin/WeakRef.native.kt index 4de74a1..b48d501 100644 --- a/weak/src/nativeMain/kotlin/WeakRef.native.kt +++ b/weak/src/nativeMain/kotlin/WeakRef.native.kt @@ -40,7 +40,7 @@ private class NativeWeakRef( @ExperimentalWeakApi @ExperimentalNativeApi actual fun WeakRef(value: T): WeakRef = - if (value == null) EmptyWeakRef(value) + if (value == null) EmptyWeakRef() else NativeWeakRef(value) /**