mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-13 00:59:29 +08:00
Compare commits
2 Commits
5c7293eada
...
876c87465d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
876c87465d | ||
|
|
bd2679c647 |
7
tree.go
7
tree.go
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user