(path []byte, query []byte)
| 204 | } |
| 205 | |
| 206 | func countBoundaryHits(path []byte, query []byte) int { |
| 207 | if len(query) == 0 || len(path) == 0 { |
| 208 | return 0 |
| 209 | } |
| 210 | hits := 0 |
| 211 | qi := 0 |
| 212 | for pi := 0; pi < len(path) && qi < len(query); pi++ { |
| 213 | atBoundary := pi == 0 || isBoundary(path[pi-1]) |
| 214 | if atBoundary && toLowerASCII(path[pi]) == toLowerASCII(query[qi]) { |
| 215 | hits++ |
| 216 | qi++ |
| 217 | } |
| 218 | } |
| 219 | return hits |
| 220 | } |
| 221 | |
| 222 | func equalFoldASCII(a, b []byte) bool { |
| 223 | if len(a) != len(b) { |
no test coverage detected