Skip to content

Commit cc023df

Browse files
committed
Fix error in insertion point logic
1 parent 0960696 commit cc023df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/shared/src/main/scala/fs2/Chunk.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ object Chunk
978978
chunks(j + 1)(0)
979979
} else {
980980
// The requested index is not an exact match but located in the chunk after the returned insertion point
981-
val k = -j + 1
981+
val k = -(j + 1)
982982
val accLenBefore = if (k == 0) 0 else lengths(k - 1)
983983
chunks(k)(i - accLenBefore)
984984
}

0 commit comments

Comments
 (0)