Avoid double alloc
This commit is contained in:
parent
852c1967b9
commit
baebdee6de
|
@ -332,7 +332,7 @@ func firstPass(p *parser, input []byte) []byte {
|
|||
// when last line was none blank and a fenced code block comes after
|
||||
if beg >= lastFencedCodeBlockEnd {
|
||||
// tmp var so we don't modify beyond bounds of `input`
|
||||
var tmp = make([]byte, len(input[beg:]))
|
||||
var tmp = make([]byte, len(input[beg:]), len(input[beg:]) + 1)
|
||||
copy(tmp, input[beg:])
|
||||
if i := p.fencedCode(&out, append(tmp, '\n'), false); i > 0 {
|
||||
if !lastLineWasBlank {
|
||||
|
|
Loading…
Reference in New Issue