mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-30 19:55:04 -04:00
caddyfile: Switch to slices.Equal for better performance (#6061)
This commit is contained in:
parent
e965b111cd
commit
7c48b5fdbb
@ -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…
x
Reference in New Issue
Block a user