mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 00:28:25 +00: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…
x
Reference in New Issue
Block a user