Performance fix: compare file and document text length instead of entire text

This commit is contained in:
Rustam Vishnyakov
2014-11-24 17:30:28 +03:00
parent 0d0a477b39
commit 391ba2057c
@@ -64,8 +64,9 @@ public class FormattingDocumentModelImpl implements FormattingDocumentModel {
if (PsiDocumentManager.getInstance(file.getProject()).isUncommited(document)) {
LOG.error("Document is uncommitted");
}
if (!file.textMatches(document.getImmutableCharSequence())) {
LOG.error("Document and psi file texts should be equal: file " + file);
if (file.getTextLength() != document.getTextLength()) {
LOG.error("Document and psi file texts should be equal: " +
file + " file length = " + file.getTextLength() + ", document length = " + document.getTextLength());
}
return new FormattingDocumentModelImpl(document, file);
}