Skip to content

Commit 411c67c

Browse files
committed
copy scanned line before passing on (Fixes #6)
1 parent df0e4d0 commit 411c67c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/reader/reader.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func Read(config Config, reports chan<- Report) {
6969
// Skip consecutive duplicates
7070
lineHash = xxhash.Sum64(line)
7171
if lineHash != prevHash {
72-
lines <- line
72+
lineCopy := make([]byte, len(line))
73+
copy(lineCopy, line)
74+
lines <- lineCopy
7375
prevHash = lineHash
7476
}
7577
} else {

0 commit comments

Comments
 (0)