Skip to content

Commit

Permalink
無駄なコピーを排除
Browse files Browse the repository at this point in the history
  • Loading branch information
masa23 committed Jul 24, 2019
1 parent 46fbff1 commit 03ad44e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ func (t *Tail) Scan() bool {

for {
if t.scanner.Scan() {
scbytes := t.scanner.Bytes()
data := make([]byte, len(scbytes))
copy(data, t.scanner.Bytes())
t.data <- data
t.data <- t.scanner.Bytes()
return true
}

Expand Down

0 comments on commit 03ad44e

Please sign in to comment.