Is the leading prefix of b lexicographically less than s?
(b []byte, s string)
| 775 | |
| 776 | // Is the leading prefix of b lexicographically less than s? |
| 777 | func prefixIsLessThan(b []byte, s string) bool { |
| 778 | for i := 0; i < len(s); i++ { |
| 779 | if i >= len(b) { |
| 780 | return true |
| 781 | } |
| 782 | if b[i] != s[i] { |
| 783 | return b[i] < s[i] |
| 784 | } |
| 785 | } |
| 786 | return false |
| 787 | } |
| 788 | |
| 789 | // Binary shift left (/ 2) by k bits. k <= maxShift to avoid overflow. |
| 790 | func leftShift(a *decimal, k uint) { |
no outgoing calls
no test coverage detected
searching dependent graphs…