dumb tweak that gives a little speed bump
Russ Ross russ@russross.com
Fri, 24 Jun 2011 21:53:46 -0600
1 files changed,
7 insertions(+),
0 deletions(-)
jump to
M
html.go
→
html.go
@@ -123,6 +123,13 @@
func attrEscape(out *bytes.Buffer, src []byte) { org := 0 for i, ch := range src { + // doing this check is a bit faster than falling into + // the switch statement. as the compiler improves, this + // should be unnecessary + if ch != '"' && ch != '&' && ch != '<' && ch != '>' { + continue + } + switch ch { case '<': if i > org {