We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e22e50 commit bd2679cCopy full SHA for bd2679c
tree.go
@@ -671,12 +671,7 @@ walk: // Outer loop for walking the tree
671
func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) ([]byte, bool) {
672
const stackBufSize = 128
673
674
- // Use a static sized buffer on the stack in the common case.
675
- // If the path is too long, allocate a buffer on the heap instead.
676
- buf := make([]byte, 0, stackBufSize)
677
- if length := len(path) + 1; length > stackBufSize {
678
- buf = make([]byte, 0, length)
679
- }
+ buf := make([]byte, 0, max(stackBufSize, len(path)+1))
680
681
ciPath := n.findCaseInsensitivePathRec(
682
path,
0 commit comments