From e882b3d3d2ebc5fb135765840c1d69baff4fe740 Mon Sep 17 00:00:00 2001 From: "Andrei.Kuznetsov" Date: Thu, 18 Sep 2025 18:39:26 +0200 Subject: [PATCH] IJPL-189375 do not update VFS record when there are no actual changes GitOrigin-RevId: 532f67e423562c35152599322bd7d2bf168c0802 --- .../openapi/vfs/newvfs/persistent/PersistentFSImpl.java | 9 +++------ 1 file changed, 3 insertions(+), 6 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 30985723f2e6..9b5be541fc5b 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 @@ -912,14 +912,11 @@ public final class PersistentFSImpl extends PersistentFS implements Disposable { else { //just actualise the length: vfsPeer.updateRecordFields(fileId, record -> { - record.setLength(content.length); + boolean lengthChanged = record.setLength(content.length); int oldFlags = record.getFlags(); int flags = oldFlags & ~Flags.MUST_RELOAD_LENGTH; - - if (oldFlags != flags) { - record.setFlags(flags); - } - return true; + boolean flagsChanged = record.setFlags(flags); + return lengthChanged || flagsChanged; }); }