mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 22:34:15 -05:00
caddyfile: Switch to slices.Equal for better performance (#6061)
This commit is contained in:
parent
e965b111cd
commit
7c48b5fdbb
1 changed files with 3 additions and 1 deletions
|
@ -18,6 +18,8 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
"golang.org/x/exp/slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Format formats the input Caddyfile to a standard, nice-looking
|
// Format formats the input Caddyfile to a standard, nice-looking
|
||||||
|
@ -128,7 +130,7 @@ func Format(input []byte) []byte {
|
||||||
heredocClosingMarker = heredocClosingMarker[1:]
|
heredocClosingMarker = heredocClosingMarker[1:]
|
||||||
}
|
}
|
||||||
// check if we're done
|
// check if we're done
|
||||||
if string(heredocClosingMarker) == string(heredocMarker) {
|
if slices.Equal(heredocClosingMarker, heredocMarker) {
|
||||||
heredocMarker = nil
|
heredocMarker = nil
|
||||||
heredocClosingMarker = nil
|
heredocClosingMarker = nil
|
||||||
heredoc = heredocClosed
|
heredoc = heredocClosed
|
||||||
|
|
Loading…
Reference in a new issue