dumb tweak that gives a little speed bump

This commit is contained in:
Russ Ross 2011-06-24 21:53:46 -06:00
parent 44db721708
commit 45ab8d0dc4

View File

@ -123,6 +123,13 @@ func HtmlTocRenderer(flags int) *Renderer {
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 {