Replace performSelector with for-loop in HTML Node methods
This commit is contained in:
+10
-4
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user