Skip to content
Myr

add an edge case from httprouter (#1407)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by 田欧 · committed by Bo-Yi Wu · parent 760d057 · Browse files · 2 files+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−1 removed

  • other:+2 added−1 removed

2 files+2 added−1 removed

modified:path_test.go+1 added
22 unmodified lines
23 {"/a/b/c/", "/a/b/c/"},2425 // missing root26 {"", "/"},27 {"a/", "/a/"},28 {"abc", "/abc"},29 {"abc/def", "/abc/def"},30 {"a/b/c", "/a/b/c"},31
58 unmodified lines
modified:path.go+1 added-1 removed
39 unmodified lines
40 buf = make([]byte, n+1)41 buf[0] = '/'42 }4344 trailing := n > 2 && p[n-1] == '/'44 trailing := n > 1 && p[n-1] == '/'4546 // A bit more clunky without a 'lazybuf' like the path package, but the loop47 // gets completely inlined (bufApp). So in contrast to the path package this48 // loop has no expensive function calls (except 1x make)
75 unmodified lines