mirror of
https://github.com/golang/go.git
synced 2026-06-27 03:11:23 +00:00
html/template: use zero-alloc bytes.EqualFold
Change-Id: I2357b88ded7ac9f08848a67115dce6539c3c6428 Reviewed-on: https://go-review.googlesource.com/c/go/+/773820 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Nicholas Husin <nsh@golang.org>
This commit is contained in:
parent
66843181d1
commit
3b7d571c99
1 changed files with 1 additions and 1 deletions
|
|
@ -426,7 +426,7 @@ func tJSDelimited(c context, s []byte) (context, int) {
|
|||
// If "</script" appears in a regex literal, the '/' should not
|
||||
// close the regex literal, and it will later be escaped to
|
||||
// "\x3C/script" in escapeText.
|
||||
if i > 0 && i+7 <= len(s) && bytes.Equal(bytes.ToLower(s[i-1:i+7]), []byte("</script")) {
|
||||
if i > 0 && i+7 <= len(s) && bytes.EqualFold(s[i-1:i+7], []byte("</script")) {
|
||||
i++
|
||||
} else if !inCharset {
|
||||
c.state, c.jsCtx = stateJS, jsCtxDivOp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue