longestPrefix finds the length of the shared prefix of two strings
(k1, k2 string)
| 772 | |
| 773 | // longestPrefix finds the length of the shared prefix of two strings |
| 774 | func longestPrefix(k1, k2 string) (i int) { |
| 775 | for i = 0; i < min(len(k1), len(k2)); i++ { |
| 776 | if k1[i] != k2[i] { |
| 777 | break |
| 778 | } |
| 779 | } |
| 780 | return |
| 781 | } |
| 782 | |
| 783 | type nodes []*node |
| 784 |
no outgoing calls
no test coverage detected