Is the leading prefix of b lexicographically less than s?
(b []byte, s string)
| 217 | |
| 218 | // Is the leading prefix of b lexicographically less than s? |
| 219 | func prefixIsLessThan(b []byte, s string) bool { |
| 220 | for i := 0; i < len(s); i++ { |
| 221 | if i >= len(b) { |
| 222 | return true |
| 223 | } |
| 224 | if b[i] != s[i] { |
| 225 | return b[i] < s[i] |
| 226 | } |
| 227 | } |
| 228 | return false |
| 229 | } |
| 230 | |
| 231 | // Binary shift left (/ 2) by k bits. k <= maxShift to avoid overflow. |
| 232 | func leftShift(a *decimal, k uint) { |
no outgoing calls
no test coverage detected
searching dependent graphs…