(p []byte)
| 35 | } |
| 36 | |
| 37 | func normalizePathBytes(p []byte) []byte { |
| 38 | j := 0 |
| 39 | prevSlash := false |
| 40 | for i := 0; i < len(p); i++ { |
| 41 | c := p[i] |
| 42 | if c == '\\' { |
| 43 | c = '/' |
| 44 | } |
| 45 | c = toLowerASCII(c) |
| 46 | if c == '/' { |
| 47 | if prevSlash { |
| 48 | continue |
| 49 | } |
| 50 | prevSlash = true |
| 51 | } else { |
| 52 | prevSlash = false |
| 53 | } |
| 54 | p[j] = c |
| 55 | j++ |
| 56 | } |
| 57 | return p[:j] |
| 58 | } |
| 59 | |
| 60 | // extractTrigrams returns deduplicated, sorted trigrams (three-byte |
| 61 | // subsequences) from s. Trigrams are the primary index key: a |
no test coverage detected