func()

in api/v1/composition.go [141:157]


func (i *InputRevisions) Less(b InputRevisions) bool {
	if i.Key != b.Key {
		panic(fmt.Sprintf("cannot compare input revisions for different keys: %s != %s", i.Key, b.Key))
	}
	if i.Revision != nil && b.Revision != nil {
		return *i.Revision < *b.Revision
	}
	if i.ResourceVersion == b.ResourceVersion {
		return false
	}
	iInt, iErr := strconv.Atoi(i.ResourceVersion)
	bInt, bErr := strconv.Atoi(b.ResourceVersion)
	if iErr != nil || bErr != nil {
		return true // effectively fall back to equality comparison if they aren't ints (shouldn't be possible)
	}
	return iInt < bInt
}