]> Cypherpunks repositories - gostls13.git/commit
html: lazily populate Unescape tables
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 31 Jul 2018 21:37:35 +0000 (21:37 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 31 Jul 2018 22:10:54 +0000 (22:10 +0000)
commit740e589bd00e330ac38e5aa146961f0d49ff1871
tree5223ca6b8ef7e9960a0af50fdf7dbecfb043b05f
parent04c095886f31c9642c91cfc889bd1d47f3a9e0ce
html: lazily populate Unescape tables

Saves ~105KB of heap for callers who don't use html.UnescapeString.
(EscapeString is much more common).

Also saves 70KB of binary size, because now the linker can do dead
code elimination. (because #2559 is still open and global maps always
generate init code)

Fixes #26727
Updates #6853

Change-Id: I18fe9a273097e2c7e0cb7f88205cae1bb60fa89b
Reviewed-on: https://go-review.googlesource.com/127075
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/html/entity.go
src/html/entity_test.go
src/html/escape.go