MCPcopy Create free account
hub / github.com/bytebase/bytebase / LessThan

Method LessThan

backend/store/model/version.go:30–41  ·  view source on GitHub ↗
(other *Version)

Source from the content-addressed store, hash-verified

28}
29
30func (v *Version) LessThan(other *Version) bool {
31 l := min(len(other.parts), len(v.parts))
32 for i := range l {
33 if v.parts[i] > other.parts[i] {
34 return false
35 }
36 if v.parts[i] < other.parts[i] {
37 return true
38 }
39 }
40 return len(v.parts) < len(other.parts)
41}
42
43func (v *Version) LessThanOrEqual(other *Version) bool {
44 return !other.LessThan(v)

Callers 4

TestVersionLessThanFunction · 0.95
LessThanOrEqualMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestVersionLessThanFunction · 0.76