From 993ec4bbe168e5ea8e760980e17b06aee6ccf28b Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Wed, 2 Mar 2016 18:53:13 +0300 Subject: [PATCH] IDEA-119539 Optimized before and after filepaths comparison while detecting if "Change" is move/rename Frequent "FilePath.getIOFile()" calls could lead to performance issues. For instance, there are snapshots with slow "Change.isMoved() or Change.isRenamed()" -> "Change.cacheRenameOrMove()" -> "Change.revisionPathsSame()" -> "LocalFilePath.getIOFile()" method calls. --- .../src/com/intellij/openapi/vcs/changes/Change.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/changes/Change.java b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/changes/Change.java index 82c14e6bf48f..083d36adb6b4 100644 --- a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/changes/Change.java +++ b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/changes/Change.java @@ -213,8 +213,9 @@ public class Change { } private boolean revisionPathsSame() { - final String path1 = myBeforeRevision.getFile().getIOFile().getAbsolutePath(); - final String path2 = myAfterRevision.getFile().getIOFile().getAbsolutePath(); + final String path1 = myBeforeRevision.getFile().getPath(); + final String path2 = myAfterRevision.getFile().getPath(); + // intentionally comparing case-sensitively even on case-insensitive OS to identify case-only renames return path1.equals(path2); }