@@ -775,18 +775,18 @@ private PendingBlock writeBlock(
775775
776776 assert StringHelper .startsWith (term .termBytes , prefix ) : term + " prefix=" + prefix ;
777777 BlockTermState state = term .state ;
778- final int suffix = term .termBytes .length - prefixLength ;
778+ final int suffixLength = term .termBytes .length - prefixLength ;
779779 // if (DEBUG2) {
780- // BytesRef suffixBytes = new BytesRef(suffix );
781- // System.arraycopy(term.termBytes, prefixLength, suffixBytes.bytes, 0, suffix );
782- // suffixBytes.length = suffix ;
783- // System.out.println(" write term suffix =" +
780+ // BytesRef suffixBytes = new BytesRef(suffixLength );
781+ // System.arraycopy(term.termBytes, prefixLength, suffixBytes.bytes, 0, suffixLength );
782+ // suffixBytes.length = suffixLength ;
783+ // System.out.println(" write term suffixLength =" +
784784 // ToStringUtils.bytesRefToString(suffixBytes));
785785 // }
786786
787- // For leaf block we write suffix straight
788- suffixLengthsWriter .writeVInt (suffix );
789- suffixWriter .append (term .termBytes , prefixLength , suffix );
787+ // For leaf block we write suffixLength straight
788+ suffixLengthsWriter .writeVInt (suffixLength );
789+ suffixWriter .append (term .termBytes , prefixLength , suffixLength );
790790 assert floorLeadLabel == -1 || (term .termBytes [prefixLength ] & 0xff ) >= floorLeadLabel ;
791791
792792 // Write term stats, to separate byte[] blob:
@@ -809,12 +809,12 @@ private PendingBlock writeBlock(
809809
810810 assert StringHelper .startsWith (term .termBytes , prefix ) : term + " prefix=" + prefix ;
811811 BlockTermState state = term .state ;
812- final int suffix = term .termBytes .length - prefixLength ;
812+ final int suffixLength = term .termBytes .length - prefixLength ;
813813 // if (DEBUG2) {
814- // BytesRef suffixBytes = new BytesRef(suffix );
815- // System.arraycopy(term.termBytes, prefixLength, suffixBytes.bytes, 0, suffix );
816- // suffixBytes.length = suffix ;
817- // System.out.println(" write term suffix =" +
814+ // BytesRef suffixBytes = new BytesRef(suffixLength );
815+ // System.arraycopy(term.termBytes, prefixLength, suffixBytes.bytes, 0, suffixLength );
816+ // suffixBytes.length = suffixLength ;
817+ // System.out.println(" write term suffixLength =" +
818818 // ToStringUtils.bytesRefToString(suffixBytes));
819819 // }
820820
@@ -823,8 +823,8 @@ private PendingBlock writeBlock(
823823 // it's a prefix term. Terms cannot be larger than ~32 KB
824824 // so we won't run out of bits:
825825
826- suffixLengthsWriter .writeVInt (suffix << 1 );
827- suffixWriter .append (term .termBytes , prefixLength , suffix );
826+ suffixLengthsWriter .writeVInt (suffixLength << 1 );
827+ suffixWriter .append (term .termBytes , prefixLength , suffixLength );
828828
829829 // Write term stats, to separate byte[] blob:
830830 statsWriter .add (state .docFreq , state .totalTermFreq );
@@ -843,21 +843,22 @@ private PendingBlock writeBlock(
843843 } else {
844844 PendingBlock block = (PendingBlock ) ent ;
845845 assert StringHelper .startsWith (block .prefix , prefix );
846- final int suffix = block .prefix .length - prefixLength ;
846+ final int suffixLength = block .prefix .length - prefixLength ;
847847 assert StringHelper .startsWith (block .prefix , prefix );
848848
849- assert suffix > 0 ;
849+ assert suffixLength > 0 ;
850850
851851 // For non-leaf block we borrow 1 bit to record
852852 // if entry is term or sub-block:f
853- suffixLengthsWriter .writeVInt ((suffix << 1 ) | 1 );
854- suffixWriter .append (block .prefix .bytes , prefixLength , suffix );
853+ suffixLengthsWriter .writeVInt ((suffixLength << 1 ) | 1 );
854+ suffixWriter .append (block .prefix .bytes , prefixLength , suffixLength );
855855
856856 // if (DEBUG2) {
857- // BytesRef suffixBytes = new BytesRef(suffix);
858- // System.arraycopy(block.prefix.bytes, prefixLength, suffixBytes.bytes, 0, suffix);
859- // suffixBytes.length = suffix;
860- // System.out.println(" write sub-block suffix=" +
857+ // BytesRef suffixBytes = new BytesRef(suffixLength);
858+ // System.arraycopy(block.prefix.bytes, prefixLength, suffixBytes.bytes, 0,
859+ // suffixLength);
860+ // suffixBytes.length = suffixLength;
861+ // System.out.println(" write sub-block suffixLength=" +
861862 // ToStringUtils.bytesRefToString(suffixBytes) + " subFP=" + block.fp + " subCode=" +
862863 // (startFP-block.fp) + " floor=" + block.isFloor);
863864 // }
0 commit comments