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.
This commit is contained in:
Konstantin Kolosovsky
2016-03-04 16:11:31 +03:00
parent fae857b99e
commit 993ec4bbe1
@@ -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);
}