avoid sort if there is 1 transition

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1004726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-10-05 17:24:59 +00:00
parent 358cbb221b
commit 1816eee6bd
1 changed files with 2 additions and 1 deletions

View File

@ -232,7 +232,8 @@ public class State implements Serializable, Comparable<State> {
/** Sorts transitions array in-place. */
public void sortTransitions(Comparator<Transition> comparator) {
Arrays.sort(transitionsArray, 0, numTransitions, comparator);
if (numTransitions > 1)
Arrays.sort(transitionsArray, 0, numTransitions, comparator);
}
/**