MCPcopy Create free account
hub / github.com/pquerna/ffjson / prefixIsLessThan

Function prefixIsLessThan

fflib/v1/internal/atof.go:777–787  ·  view source on GitHub ↗

Is the leading prefix of b lexicographically less than s?

(b []byte, s string)

Source from the content-addressed store, hash-verified

775
776// Is the leading prefix of b lexicographically less than s?
777func 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.
790func leftShift(a *decimal, k uint) {

Callers 1

leftShiftFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…