From 296d2db8cfbfe38a95d4437f72055a9a6a09fea2 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Mon, 17 Oct 2022 12:14:03 +0600 Subject: [PATCH] Use strings.Builder instead of bytes.Buffer in feDropShadow fix --- svg/svg.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/svg/svg.go b/svg/svg.go index f36fa3a4..9bacae47 100644 --- a/svg/svg.go +++ b/svg/svg.go @@ -81,11 +81,13 @@ func Satitize(data *imagedata.ImageData) (*imagedata.ImageData, error) { } func replaceDropShadowNode(l *xml.Lexer, buf *bytes.Buffer) error { - inAttrs := new(bytes.Buffer) - blurAttrs := new(bytes.Buffer) - offsetAttrs := new(bytes.Buffer) - floodAttrs := new(bytes.Buffer) - finalAttrs := new(bytes.Buffer) + var ( + inAttrs strings.Builder + blurAttrs strings.Builder + offsetAttrs strings.Builder + floodAttrs strings.Builder + finalAttrs strings.Builder + ) inID, _ := nanoid.New(8) offsetID, _ := nanoid.New(8)