[maven] IDEA-341081 simplify logic in performSearchAsync: look up in cache once

GitOrigin-RevId: 9a8e8f30d2a6e6f335fe3843ef895982f858869f
This commit is contained in:
Dmitry Kichinsky
2024-01-05 21:41:44 +01:00
committed by intellij-monorepo-bot
parent c73b03bb82
commit efab2dd9bd

View File

@@ -125,13 +125,6 @@ class DependencySearchService(private val project: Project) : Disposable {
parameters: SearchParameters,
consumer: ResultConsumer,
searchMethod: (DependencySearchProvider, ResultConsumer) -> Unit) {
if (parameters.useCache()) {
val cachedValue = foundInCache(cacheKey, consumer)
if (cachedValue != null) {
return
}
}
val thisNewFuture = CompletableFuture<Collection<RepositoryArtifactData>>()
val existingFuture = cache.putIfAbsent(cacheKey, thisNewFuture)
if (existingFuture != null && parameters.useCache()) {