MCPcopy Create free account
hub / github.com/facebook/time / Less

Method Less

ptp/protocol/types.go:279–279  ·  view source on GitHub ↗

Less reports whether p sorts before q. Port identities sort first by clock identity, then their port numbers.

(q PortIdentity)

Source from the content-addressed store, hash-verified

277// String formats PortIdentity same way ptp4l pmc client does
278func (p PortIdentity) String() string {
279 return fmt.Sprintf("%s-%d", p.ClockIdentity, p.PortNumber)
280}
281
282// Compare returns an integer comparing two port identities. The result will be 0 if p == q, -1 if p < q, and +1 if p > q.

Callers 1

TestPortIdentityLessFunction · 0.95

Calls 1

CompareMethod · 0.95

Tested by 1

TestPortIdentityLessFunction · 0.76