IJPL-189375 do not update VFS record when there are no actual changes

GitOrigin-RevId: 532f67e423562c35152599322bd7d2bf168c0802
This commit is contained in:
Andrei.Kuznetsov
2025-10-07 10:41:27 +00:00
committed by intellij-monorepo-bot
parent 632c56b88d
commit e882b3d3d2
@@ -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;
});
}