MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / mapsEqual

Function mapsEqual

source/core/StarAlgorithm.hpp:127–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126template <typename MapType1, typename MapType2>
127bool mapsEqual(MapType1 const& m1, MapType2 const& m2) {
128 if (&m1 == &m2)
129 return true;
130
131 if (m1.size() != m2.size())
132 return false;
133
134 for (auto const& m1pair : m1) {
135 auto m2it = m2.find(m1pair.first);
136 if (m2it == m2.end() || !(m2it->second == m1pair.second))
137 return false;
138 }
139
140 return true;
141}
142
143template <typename Container, typename Filter>
144void filter(Container& container, Filter&& filter) {

Callers 2

operator==Method · 0.85
operator==Method · 0.85

Calls 3

sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected