From 01ceb4ebbb628eefc1b2f99d0eed951a08d2dcd5 Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Thu, 2 Feb 2023 12:52:37 +0400 Subject: [PATCH] IDEA-311645 Inspection suggestion GitOrigin-RevId: 00de79cc7a235a17737a5af5ae9a6a27b12c5942 --- .../src/com/intellij/ui/tree/AsyncTreeModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java b/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java index a8bcba88ef78..426dec119b5b 100644 --- a/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java +++ b/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ui.tree; import com.intellij.openapi.Disposable; @@ -881,7 +881,7 @@ public final class AsyncTreeModel extends AbstractTreeModel implements Searchabl } private void updatePaths(@NotNull Object oldObject, @NotNull Object newObject) { - if (paths.stream().anyMatch(path -> contains(path, oldObject))) { + if (ContainerUtil.exists(paths, path -> contains(path, oldObject))) { // replace instance of user's object in all internal maps to avoid memory leaks List updated = ContainerUtil.map(paths, path -> update(path, oldObject, newObject)); paths.clear();