From 03e03cfa69bb3277cda8cb0c66c96c3c0b5edd9c Mon Sep 17 00:00:00 2001 From: Carlo Alberto Ferraris Date: Sat, 29 Feb 2020 16:28:16 +0900 Subject: [PATCH] Do not copy escape tables --- jwriter/writer.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jwriter/writer.go b/jwriter/writer.go index eb8547c..2c5b201 100644 --- a/jwriter/writer.go +++ b/jwriter/writer.go @@ -297,11 +297,9 @@ func (w *Writer) String(s string) { p := 0 // last non-escape symbol - var escapeTable [128]bool + escapeTable := &htmlEscapeTable if w.NoEscapeHTML { - escapeTable = htmlNoEscapeTable - } else { - escapeTable = htmlEscapeTable + escapeTable = &htmlNoEscapeTable } for i := 0; i < len(s); {