Skip to content

Commit f90c59a

Browse files
authored
Minor bug fix for SplitRecursively: split right before it's too large. (#165)
1 parent 080ba2f commit f90c59a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ops/functions/split_recursively.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ impl<'t, 's: 't> RecursiveChunker<'s> {
334334
return;
335335
}
336336
let mut start_pos = chunks[0].start;
337-
for i in 1..chunks.len() - 1 {
338-
let chunk = &chunks[i];
339-
if chunk.end - start_pos > self.chunk_size {
337+
for i in 0..chunks.len() - 1 {
338+
let next_chunk = &chunks[i + 1];
339+
if next_chunk.end - start_pos > self.chunk_size {
340+
let chunk = &chunks[i];
340341
self.add_output(RangeValue::new(start_pos, chunk.end), output);
341342

342343
// Find the new start position, allowing overlap within the threshold.
343344
let mut new_start_idx = i + 1;
344-
let next_chunk = &chunks[i + 1];
345345
while new_start_idx > 0 {
346346
let prev_pos = chunks[new_start_idx - 1].start;
347347
if prev_pos <= start_pos

0 commit comments

Comments
 (0)