From c613d3970fdcd8869f197f61fe59bda5da3a1e38 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 20 Feb 2015 12:03:19 +0100 Subject: [PATCH] DocumentImpl: a faster check for no assertions --- .../src/com/intellij/openapi/editor/impl/DocumentImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java b/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java index 5543c430f361..a7f54fc9c8dd 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java @@ -770,10 +770,10 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx { } private void assertInsideCommand() { + if (!myAssertThreading) return; CommandProcessor commandProcessor = CommandProcessor.getInstance(); if (!commandProcessor.isUndoTransparentActionInProgress() && - commandProcessor.getCurrentCommand() == null && - myAssertThreading) { + commandProcessor.getCurrentCommand() == null) { throw new IncorrectOperationException("Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor"); } }