Merge bd2679c647de9745dc6c138520d0bf9eca751ef3 into 52ecf029bd2e9b4d2652f96dd2b753f8bc6b6e95

This commit is contained in:
Artur Melanchyk 2025-11-27 08:54:04 +08:00 committed by GitHub
commit 88b72523c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -680,12 +680,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,