prefixesDifferent returns true if the two slices contain different prefixes where order doesn't matter.
(a, b []netip.Prefix)
| 766 | // prefixesDifferent returns true if the two slices contain different prefixes |
| 767 | // where order doesn't matter. |
| 768 | func prefixesDifferent(a, b []netip.Prefix) bool { |
| 769 | if len(a) != len(b) { |
| 770 | return true |
| 771 | } |
| 772 | as := make(map[string]bool) |
| 773 | for _, p := range a { |
| 774 | as[p.String()] = true |
| 775 | } |
| 776 | for _, p := range b { |
| 777 | if !as[p.String()] { |
| 778 | return true |
| 779 | } |
| 780 | } |
| 781 | return false |
| 782 | } |
| 783 | |
| 784 | // derpMapStringer converts a DERPMap into a readable string for logging, since |
| 785 | // it includes pointers that we want to know the contents of, not actual pointer |
no test coverage detected