MCPcopy Create free account
hub / github.com/apple/foundationdb / netmaskWeightImpl

Function netmaskWeightImpl

fdbrpc/IPAllowList.cpp:42–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template <size_t Sz>
42int netmaskWeightImpl(std::array<unsigned char, Sz> const& addr) {
43 int count = 0;
44 for (int i = 0; i < addr.size() && addr[i] != 0xff; ++i) {
45 std::bitset<8> b(addr[i]);
46 count += 8 - b.count();
47 }
48 return count;
49}
50
51} // namespace
52

Callers 1

netmaskWeightMethod · 0.85

Calls 2

countMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected