mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[maven] IDEA-341081 simplify logic in performSearchAsync: look up in cache once
GitOrigin-RevId: 9a8e8f30d2a6e6f335fe3843ef895982f858869f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c73b03bb82
commit
efab2dd9bd
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user