Spellchecker IDEA-100509 slow on large files / minor - DTO List is often empty.

This commit is contained in:
Alexey Gopachenko
2013-02-12 17:38:33 +01:00
parent b7f396ea89
commit f6b6b2c59c
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,12 +21,12 @@ import com.intellij.openapi.progress.ProgressIndicatorProvider;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Consumer;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
@@ -96,7 +96,7 @@ public abstract class BaseSplitter implements Splitter {
@NotNull
static protected List<TextRange> excludeByPattern(String text, TextRange range, @NotNull Pattern toExclude, int groupToInclude) {
List<TextRange> toCheck = new ArrayList<TextRange>();
List<TextRange> toCheck = new SmartList<TextRange>();
int from = range.getStartOffset();
int till;
boolean addLast = true;