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

Function sortAdvertisements

core/ipc_handler.go:396–403  ·  view source on GitHub ↗
(entries []*protocol.Advertisement)

Source from the content-addressed store, hash-verified

394}
395
396func sortAdvertisements(entries []*protocol.Advertisement) {
397 slices.SortFunc(entries, func(a, b *protocol.Advertisement) int {
398 if c := cmp.Compare(a.Prefix, b.Prefix); c != 0 {
399 return c
400 }
401 return cmp.Compare(a.NodeId, b.NodeId)
402 })
403}
404
405func sortRouteTableEntries(entries []*protocol.RouteTableEntry) {
406 slices.SortFunc(entries, func(a, b *protocol.RouteTableEntry) int {

Callers 2

buildAdvertisementsFunction · 0.85
advertisementsForNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected