Do not run partial body resolve if full body resolve already cached
This commit is contained in:
@@ -411,6 +411,12 @@ public class LockBasedStorageManager implements StorageManager {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComputed(K key) {
|
||||
Object value = cache.get(key);
|
||||
return value != null && value != NotValue.COMPUTING;
|
||||
}
|
||||
}
|
||||
|
||||
private class MapBasedMemoizedFunctionToNotNull<K, V> extends MapBasedMemoizedFunction<K, V> implements MemoizedFunctionToNotNull<K, V> {
|
||||
|
||||
@@ -16,8 +16,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.storage
|
||||
|
||||
public trait MemoizedFunctionToNotNull<P, R : Any> : Function1<P, R>
|
||||
public trait MemoizedFunctionToNullable<P, R : Any> : Function1<P, R?>
|
||||
public trait MemoizedFunctionToNotNull<P, R : Any> : Function1<P, R> {
|
||||
public fun isComputed(key: P): Boolean
|
||||
}
|
||||
|
||||
public trait MemoizedFunctionToNullable<P, R : Any> : Function1<P, R?> {
|
||||
public fun isComputed(key: P): Boolean
|
||||
}
|
||||
|
||||
public trait NotNullLazyValue<T : Any> : Function0<T> {
|
||||
public fun isComputed(): Boolean
|
||||
|
||||
Reference in New Issue
Block a user