Skip to content

Commit 68f206a

Browse files
committed
Added pre-allocation to Dump() builder.
1 parent 0238c89 commit 68f206a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

difflib/difflib.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ func (d *Differ) Dump(tag string, x []string, low int, high int) (out []string)
599599
sout := d.StructuredDump(tag[0], x, low, high)
600600
out = make([]string, len(sout))
601601
var bld strings.Builder
602+
bld.Grow(1024)
602603
for i, line := range sout {
603604
bld.Reset()
604605
bld.WriteByte(line.Tag)

0 commit comments

Comments
 (0)