mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
dumb tweak that gives a little speed bump
This commit is contained in:
parent
44db721708
commit
45ab8d0dc4
7
html.go
7
html.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user