Skip to content

Commit 66512ed

Browse files
committed
fix: replace subList with slice
This fixes a long-standing bug, where we did not copy the list, but merely return of view of it.
1 parent 4ae46bc commit 66512ed

File tree

1 file changed

+1
-1
lines changed
  • src/commonMain/kotlin/io/github/petertrr/diffutils/patch

1 file changed

+1
-1
lines changed

src/commonMain/kotlin/io/github/petertrr/diffutils/patch/Patch.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public class Patch<T>(private var conflictOutput: ConflictOutput<T> = ExceptionP
9191
generate(original, revised, changes, false)
9292

9393
private fun <T> buildChunk(start: Int, end: Int, data: List<T>): Chunk<T> =
94-
Chunk(start, data.subList(start, end))
94+
Chunk(start, data.slice(start..<end))
9595

9696
public fun <T> generate(
9797
original: List<T>,

0 commit comments

Comments
 (0)