Record sets must be sorted before pairwise tiebreak comparison so hosts reach the same outcome even when authority records arrive in any order.
| 882 | // Record sets must be sorted before pairwise tiebreak comparison so hosts |
| 883 | // reach the same outcome even when authority records arrive in any order. |
| 884 | static void SortProbeRecords(ProbeRecord* records, uint32_t count) |
| 885 | { |
| 886 | for (uint32_t i = 1; i < count; ++i) |
| 887 | { |
| 888 | ProbeRecord current = records[i]; |
| 889 | uint32_t j = i; |
| 890 | while (j > 0 && CompareProbeRecord(current, records[j - 1]) < 0) |
| 891 | { |
| 892 | records[j] = records[j - 1]; |
| 893 | --j; |
| 894 | } |
| 895 | records[j] = current; |
| 896 | } |
| 897 | } |
| 898 | |
| 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. |
no test coverage detected