Replace performSelector with for-loop in HTML Node methods

This commit is contained in:
iska
2017-04-09 20:53:11 +02:00
parent b693a60358
commit 14dfc0b854
+10 -4
View File
@@ -64,7 +64,9 @@
- (void)setOwnerDocument:(HTMLDocument *)ownerDocument
{
_ownerDocument = ownerDocument;
[self.childNodes.array makeObjectsPerformSelector:@selector(setOwnerDocument:) withObject:ownerDocument];
for (HTMLNode *child in self.childNodes) {
[child setOwnerDocument:ownerDocument];
}
}
- (HTMLNode *)rootNode
@@ -271,7 +273,9 @@
[node removeAllChildNodes];
}
[nodes makeObjectsPerformSelector:@selector(setParentNode:) withObject:self];
for (HTMLNode *node in nodes) {
[node setParentNode:self];
}
return node;
}
@@ -331,7 +335,7 @@
- (void)reparentChildNodesIntoNode:(HTMLNode *)node
{
for (HTMLNode *child in self.childNodes.array) {
for (HTMLNode *child in self.childNodes) {
[node appendNode:child];
}
[(NSMutableOrderedSet *)self.childNodes removeAllObjects];
@@ -339,7 +343,9 @@
- (void)removeAllChildNodes
{
[self.childNodes.array makeObjectsPerformSelector:@selector(setParentNode:) withObject:nil];
for (HTMLNode *child in self.childNodes) {
[child setParentNode:nil];
}
[(NSMutableOrderedSet *)self.childNodes removeAllObjects];
}