@@ -47,7 +47,7 @@ final class NodeHash<T> {
4747 // (compared to e.g. LinkedHashMap) LRU behaviour. fallbackTable is read-only.
4848 private PagedGrowableHash fallbackTable ;
4949
50- private final FST <T > fst ;
50+ private final FSTCompiler <T > fstCompiler ;
5151 private final FST .Arc <T > scratchArc = new FST .Arc <>();
5252 private final FST .BytesReader in ;
5353
@@ -56,7 +56,7 @@ final class NodeHash<T> {
5656 * recently used suffixes are discarded, and the FST is no longer minimalI. Still, larger
5757 * ramLimitMB will make the FST smaller (closer to minimal).
5858 */
59- public NodeHash (FST <T > fst , double ramLimitMB , FST .BytesReader in ) {
59+ public NodeHash (FSTCompiler <T > fstCompiler , double ramLimitMB , FST .BytesReader in ) {
6060 if (ramLimitMB <= 0 ) {
6161 throw new IllegalArgumentException ("ramLimitMB must be > 0; got: " + ramLimitMB );
6262 }
@@ -69,7 +69,7 @@ public NodeHash(FST<T> fst, double ramLimitMB, FST.BytesReader in) {
6969 }
7070
7171 primaryTable = new PagedGrowableHash ();
72- this .fst = fst ;
72+ this .fstCompiler = fstCompiler ;
7373 this .in = in ;
7474 }
7575
@@ -95,8 +95,7 @@ private long getFallback(FSTCompiler.UnCompiledNode<T> nodeIn, long hash) throws
9595 }
9696 }
9797
98- public long add (FSTCompiler <T > fstCompiler , FSTCompiler .UnCompiledNode <T > nodeIn )
99- throws IOException {
98+ public long add (FSTCompiler .UnCompiledNode <T > nodeIn ) throws IOException {
10099
101100 long hash = hash (nodeIn );
102101
@@ -193,7 +192,7 @@ private long hash(long node) throws IOException {
193192 final int PRIME = 31 ;
194193
195194 long h = 0 ;
196- fst .readFirstRealTargetArc (node , scratchArc , in );
195+ fstCompiler . fst .readFirstRealTargetArc (node , scratchArc , in );
197196 while (true ) {
198197 h = PRIME * h + scratchArc .label ();
199198 h = PRIME * h + (int ) (scratchArc .target () ^ (scratchArc .target () >> 32 ));
@@ -205,7 +204,7 @@ private long hash(long node) throws IOException {
205204 if (scratchArc .isLast ()) {
206205 break ;
207206 }
208- fst .readNextRealArc (scratchArc , in );
207+ fstCompiler . fst .readNextRealArc (scratchArc , in );
209208 }
210209
211210 return h ;
@@ -216,7 +215,7 @@ private long hash(long node) throws IOException {
216215 * returning true if they are equal.
217216 */
218217 private boolean nodesEqual (FSTCompiler .UnCompiledNode <T > node , long address ) throws IOException {
219- fst .readFirstRealTargetArc (address , scratchArc , in );
218+ fstCompiler . fst .readFirstRealTargetArc (address , scratchArc , in );
220219
221220 // fail fast for a node with fixed length arcs
222221 if (scratchArc .bytesPerArc () != 0 ) {
@@ -262,7 +261,7 @@ private boolean nodesEqual(FSTCompiler.UnCompiledNode<T> node, long address) thr
262261 }
263262 }
264263
265- fst .readNextRealArc (scratchArc , in );
264+ fstCompiler . fst .readNextRealArc (scratchArc , in );
266265 }
267266
268267 // unfrozen node has fewer arcs than frozen node
0 commit comments