Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78b95e8

Browse files
Use scanner's default internal buffer
Co-authored-by: wxiaoguang <[email protected]> Signed-off-by: Fabian Meyer <[email protected]>
1 parent 60a4dab commit 78b95e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/git/foreachref/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ func NewParser(r io.Reader, format Format) *Parser {
3232

3333
// default MaxScanTokenSize = 64 kiB may be too small for some references,
3434
// so allow the buffer to grow up to 4x if needed
35-
buf := make([]byte, 0, bufio.MaxScanTokenSize)
36-
scanner.Buffer(buf, 4 * bufio.MaxScanTokenSize)
35+
scanner.Buffer(nil, 4*bufio.MaxScanTokenSize)
3736

3837
// in addition to the reference delimiter we specified in the --format,
3938
// `git for-each-ref` will always add a newline after every reference.

0 commit comments

Comments
 (0)