MCPcopy Create free account
hub / github.com/defold/defold / CompareProbeRecordSets

Function CompareProbeRecordSets

engine/dlib/src/dlib/mdns.cpp:901–914  ·  view source on GitHub ↗

Compares two sorted claim sets and returns which side is later in the RFC-defined ordering. Identical sets are not treated as conflicts.

Source from the content-addressed store, hash-verified

899 // Compares two sorted claim sets and returns which side is later in the
900 // RFC-defined ordering. Identical sets are not treated as conflicts.
901 static int CompareProbeRecordSets(const ProbeRecord* a, uint32_t a_count, const ProbeRecord* b, uint32_t b_count)
902 {
903 const uint32_t min_count = a_count < b_count ? a_count : b_count;
904 for (uint32_t i = 0; i < min_count; ++i)
905 {
906 int cmp = CompareProbeRecord(a[i], b[i]);
907 if (cmp != 0)
908 return cmp;
909 }
910
911 if (a_count != b_count)
912 return a_count < b_count ? -1 : 1;
913 return 0;
914 }
915
916 // Decodes an incoming authority claim into the same canonical form used for
917 // locally generated records. SRV names are uncompressed before comparison.

Callers 1

Calls 1

CompareProbeRecordFunction · 0.85

Tested by

no test coverage detected