File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,20 +242,20 @@ impl BlockSegmentPostings {
242242
243243 pub ( crate ) fn copy_docs_and_term_freqs (
244244 & self ,
245- start : usize ,
245+ block_offset : usize ,
246246 horizon : DocId ,
247247 docs : & mut [ DocId ] ,
248248 term_freqs : & mut [ u32 ] ,
249249 ) -> usize {
250250 debug_assert_eq ! ( docs. len( ) , term_freqs. len( ) ) ;
251251 let block_docs = self . docs ( ) ;
252- let available = block_docs. len ( ) . saturating_sub ( start ) ;
253- let max_len = available . min ( docs. len ( ) ) ;
252+ let remaining_docs_in_block = block_docs. len ( ) . saturating_sub ( block_offset ) ;
253+ let max_len = remaining_docs_in_block . min ( docs. len ( ) ) ;
254254 if max_len == 0 {
255255 return 0 ;
256256 }
257257
258- let source_docs = & block_docs[ start..start + max_len] ;
258+ let source_docs = & block_docs[ block_offset..block_offset + max_len] ;
259259 let len = if source_docs[ max_len - 1 ] < horizon {
260260 max_len
261261 } else {
@@ -268,8 +268,8 @@ impl BlockSegmentPostings {
268268 docs[ ..len] . copy_from_slice ( & source_docs[ ..len] ) ;
269269
270270 let block_freqs = self . freq_output_array ( ) ;
271- if block_freqs. len ( ) >= start + len {
272- term_freqs[ ..len] . copy_from_slice ( & block_freqs[ start..start + len] ) ;
271+ if block_freqs. len ( ) >= block_offset + len {
272+ term_freqs[ ..len] . copy_from_slice ( & block_freqs[ block_offset..block_offset + len] ) ;
273273 } else {
274274 term_freqs[ ..len] . fill ( 1 ) ;
275275 }
Original file line number Diff line number Diff line change @@ -158,26 +158,26 @@ impl SegmentPostings {
158158 docs : & mut [ DocId ; COLLECT_BLOCK_BUFFER_LEN ] ,
159159 term_freqs : & mut [ u32 ; COLLECT_BLOCK_BUFFER_LEN ] ,
160160 ) -> usize {
161- let mut filled = 0 ;
162- while filled < COLLECT_BLOCK_BUFFER_LEN && self . doc ( ) < horizon {
161+ let mut num_elems = 0 ;
162+ while num_elems < COLLECT_BLOCK_BUFFER_LEN && self . doc ( ) < horizon {
163163 let copied = self . block_cursor . copy_docs_and_term_freqs (
164164 self . cur ,
165165 horizon,
166- & mut docs[ filled ..] ,
167- & mut term_freqs[ filled ..] ,
166+ & mut docs[ num_elems ..] ,
167+ & mut term_freqs[ num_elems ..] ,
168168 ) ;
169169 if copied == 0 {
170170 break ;
171171 }
172- filled += copied;
172+ num_elems += copied;
173173 self . cur += copied;
174174
175175 if self . cur == COMPRESSION_BLOCK_SIZE {
176176 self . cur = 0 ;
177177 self . block_cursor . advance ( ) ;
178178 }
179179 }
180- filled
180+ num_elems
181181 }
182182}
183183
You can’t perform that action at this time.
0 commit comments