From 9ed6fc54e75ffa0e53743f541eadd206c109ef49 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 28 Aug 2017 19:47:31 +0300 Subject: [PATCH] avoid nonsensical clear() --- .../openapi/vfs/newvfs/persistent/PersistentFSImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index c860a774735b..876a13eb631f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -865,18 +865,17 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone int startIndex = 0; List applyEvents = new ArrayList<>(events.size()); - List validated = new ArrayList<>(events.size()); Set files = new THashSet<>(events.size()); Set middleDirs = new THashSet<>(events.size()); while (startIndex != events.size()) { applyEvents.clear(); - validated.clear(); + List validated = new ArrayList<>(events.size() - startIndex); files.clear(); middleDirs.clear(); startIndex = groupAndValidate(events, startIndex, applyEvents, validated, files, middleDirs); if (!validated.isEmpty()) { - List toSend = Collections.unmodifiableList(new ArrayList<>(validated)); + List toSend = Collections.unmodifiableList(validated); myPublisher.before(toSend); applyEvents.forEach(Runnable::run);