@@ -274,8 +274,15 @@ auto any::operator[](const any& rhs) const -> const any& {
274auto any::contains(const char key[]) const -> bool {
274auto any::contains(const char key[]) const -> bool {
275 const any& variant = unthunkVariant(*this);
275 const any& variant = unthunkVariant(*this);
276 assert(variant.type == Type::Map);
276 assert(variant.type == Type::Map);
277− for (any::map::const_iterator it = variant.m->begin(), end = variant.m->end(); it != end; ++it) {
277+ const any::map::const_iterator begin = variant.m->begin();
278+ const any::map::const_iterator end = variant.m->end();
279+ for (any::map::const_iterator it = begin; it != end; ++it) {
280+ if (it->first == key) {
284+ for (any::map::const_iterator it = begin; it != end; ++it) {
278− if (it->first == key || strcmp(it->first, key) == 0) {
285+ if (strcmp(it->first, key) == 0) {
279 return true;
286 return true;