Index: net/dns/address_sorter_posix.cc |
diff --git a/net/dns/address_sorter_posix.cc b/net/dns/address_sorter_posix.cc |
index 8d87774587d8e59a52891ce74994e76bd1c697a9..514a00f8ebf65d8f8b17b35387eee29c8dd6ea4d 100644 |
--- a/net/dns/address_sorter_posix.cc |
+++ b/net/dns/address_sorter_posix.cc |
@@ -175,30 +175,6 @@ AddressSorterPosix::PolicyEntry kDefaultIPv4ScopeTable[] = { |
{ { }, 0, AddressSorterPosix::SCOPE_GLOBAL }, |
}; |
-// Returns number of matching initial bits between the addresses |a1| and |a2|. |
-unsigned CommonPrefixLength(const IPAddressNumber& a1, |
- const IPAddressNumber& a2) { |
- DCHECK_EQ(a1.size(), a2.size()); |
- for (size_t i = 0; i < a1.size(); ++i) { |
- unsigned diff = a1[i] ^ a2[i]; |
- if (!diff) |
- continue; |
- for (unsigned j = 0; j < CHAR_BIT; ++j) { |
- if (diff & (1 << (CHAR_BIT - 1))) |
- return i * CHAR_BIT + j; |
- diff <<= 1; |
- } |
- NOTREACHED(); |
- } |
- return a1.size() * CHAR_BIT; |
-} |
- |
-// Computes the number of leading 1-bits in |mask|. |
-unsigned MaskPrefixLength(const IPAddressNumber& mask) { |
- IPAddressNumber all_ones(mask.size(), 0xFF); |
- return CommonPrefixLength(mask, all_ones); |
-} |
- |
struct DestinationInfo { |
IPAddressNumber address; |
AddressSorterPosix::AddressScope scope; |