MCPcopy Create free account
hub / github.com/encodeous/nylon / comparePubRoute

Function comparePubRoute

core/ipc_handler.go:383–394  ·  view source on GitHub ↗
(a, b *protocol.PubRoute)

Source from the content-addressed store, hash-verified

381}
382
383func comparePubRoute(a, b *protocol.PubRoute) int {
384 if c := cmp.Compare(a.Source.Prefix, b.Source.Prefix); c != 0 {
385 return c
386 }
387 if c := cmp.Compare(a.Source.NodeId, b.Source.NodeId); c != 0 {
388 return c
389 }
390 if c := cmp.Compare(a.Fd.Seqno, b.Fd.Seqno); c != 0 {
391 return c
392 }
393 return cmp.Compare(a.Fd.Metric, b.Fd.Metric)
394}
395
396func sortAdvertisements(entries []*protocol.Advertisement) {
397 slices.SortFunc(entries, func(a, b *protocol.Advertisement) int {

Callers 2

buildNeighRoutesFunction · 0.85
buildRouteTablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected