Skip to content

Commit

Permalink
Replace unnecessary empty slices with nil
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-engledew committed Jul 15, 2022
1 parent 7c59e5e commit 9685220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *Scanner) Read(p []byte) (int, error) {

// Drain returns a reader that will consume the remaining buffer.
func (s *Scanner) Drain() io.Reader {
s.Concat([]byte{})
s.Concat(nil)
return NewFragmentReader(s, true)
}

Expand All @@ -75,7 +75,7 @@ func (s *Scanner) Next(atEOF bool) (raw []byte, token *html.Token, err error) {
nextErr := s.tokenizer.Err()

if nextErr == io.ErrNoProgress {
s.Concat([]byte{})
s.Concat(nil)
if atEOF {
// recreate tokenizer
continue
Expand Down

0 comments on commit 9685220

Please sign in to comment.