Merge 8fe5246e5b845f2ae8ec42b6a414ec8979793985 into 9914178584e42458ff7d23891463a880f58c9d86

This commit is contained in:
Artur Melanchyk 2026-01-02 16:16:05 +08:00 committed by GitHub
commit 789f85b2eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -671,12 +671,7 @@ walk: // Outer loop for walking the tree
func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) ([]byte, bool) {
const stackBufSize = 128
// Use a static sized buffer on the stack in the common case.
// If the path is too long, allocate a buffer on the heap instead.
buf := make([]byte, 0, stackBufSize)
if length := len(path) + 1; length > stackBufSize {
buf = make([]byte, 0, length)
}
buf := make([]byte, 0, max(stackBufSize, len(path)+1))
ciPath := n.findCaseInsensitivePathRec(
path,