mirror of
https://github.com/apache/lucene.git
synced 2025-02-06 10:08:58 +00:00
remove code duplication by making getSortedTransitions public
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1036544 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a5d73e7dec
commit
30c2ff16b6
@ -26,7 +26,6 @@ import org.apache.lucene.util.IntsRef;
|
||||
import org.apache.lucene.util.automaton.Automaton;
|
||||
import org.apache.lucene.util.automaton.ByteRunAutomaton;
|
||||
import org.apache.lucene.util.automaton.SpecialOperations;
|
||||
import org.apache.lucene.util.automaton.State;
|
||||
import org.apache.lucene.util.automaton.Transition;
|
||||
|
||||
/**
|
||||
@ -102,12 +101,7 @@ public class AutomatonTermsEnum extends FilteredTermsEnum {
|
||||
}
|
||||
|
||||
// build a cache of sorted transitions for every state
|
||||
allTransitions = new Transition[runAutomaton.getSize()][];
|
||||
for (State state : this.automaton.getNumberedStates()) {
|
||||
state.sortTransitions(Transition.CompareByMinMaxThenDest);
|
||||
state.trimTransitionsArray();
|
||||
allTransitions[state.getNumber()] = state.transitionsArray;
|
||||
}
|
||||
allTransitions = this.automaton.getSortedTransitions();
|
||||
// used for path tracking, where each bit is a numbered state.
|
||||
visited = new long[runAutomaton.getSize()];
|
||||
|
||||
|
@ -487,7 +487,7 @@ public class Automaton implements Serializable, Cloneable {
|
||||
* Returns a sorted array of transitions for each state (and sets state
|
||||
* numbers).
|
||||
*/
|
||||
Transition[][] getSortedTransitions() {
|
||||
public Transition[][] getSortedTransitions() {
|
||||
final State[] states = getNumberedStates();
|
||||
Transition[][] transitions = new Transition[states.length][];
|
||||
for (State s : states) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user