@@ -319,12 +319,11 @@ ![_namespaces isKindOfClass: [OFMutableDictionary class]]) || (_children != nil && ![_children isKindOfClass: [OFMutableArray class]])) @throw [OFInvalidArgumentException exception]; - objectEnumerator = [_attributes objectEnumerator]; - while ((object = [objectEnumerator nextObject]) != nil) + for (object in _attributes) if (![object isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; keyEnumerator = [_namespaces keyEnumerator]; objectEnumerator = [_namespaces objectEnumerator]; @@ -332,12 +331,11 @@ (object = [objectEnumerator nextObject]) != nil) if (![key isKindOfClass: [OFString class]] || ![object isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; - objectEnumerator = [_children objectEnumerator]; - while ((object = [objectEnumerator nextObject]) != nil) + for (object in _children) if (![object isKindOfClass: [OFXMLNode class]]) @throw [OFInvalidArgumentException exception]; if (_namespaces == nil) _namespaces = [[OFMutableDictionary alloc] init]; @@ -918,22 +916,16 @@ } - (void)insertChildren: (OFArray*)children atIndex: (size_t)index { - void *pool = objc_autoreleasePoolPush(); - OFEnumerator *enumerator = [children objectEnumerator]; - OFXMLNode *node; - - while ((node = [enumerator nextObject]) != nil) + for (OFXMLNode *node in children) if ([node isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; [_children insertObjectsFromArray: children atIndex: index]; - - objc_autoreleasePoolPop(pool); } - (void)removeChild: (OFXMLNode*)child { if ([child isKindOfClass: [OFXMLAttribute class]])