209494 - use nsCOMPtr::swap() in a few loops

r+sr=bzbarsky@mit.edu
This commit is contained in:
caillon%returnzero.com 2003-06-16 00:14:23 +00:00
Родитель 7b34fa1c99
Коммит f3fdc6e727
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -973,7 +973,7 @@ nsContentUtils::GetAncestors(nsIDOMNode* aNode,
do {
aArray->AppendElement(node.get());
node->GetParentNode(getter_AddRefs(ancestor));
node = ancestor;
node.swap(ancestor);
} while (node);
return NS_OK;
@ -1016,7 +1016,7 @@ nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
ancestor->IndexOf(content, offset);
aAncestorNodes->AppendElement(ancestor.get());
aAncestorOffsets->AppendElement(NS_INT32_TO_PTR(offset));
content = ancestor;
content.swap(ancestor);
content->GetParent(getter_AddRefs(ancestor));
}
@ -1078,8 +1078,8 @@ nsContentUtils::GetFirstDifferentAncestors(nsIDOMNode *aNode,
aDifferentNodes.AppendObject(aOther);
return NS_OK;
}
node = ancestor;
} while (ancestor);
node.swap(ancestor);
} while (node);
// Insert all the ancestors of |aOther|
nsCOMPtr<nsIDOMNode> other(aOther);
@ -1091,8 +1091,8 @@ nsContentUtils::GetFirstDifferentAncestors(nsIDOMNode *aNode,
aDifferentNodes.AppendObject(aNode);
return NS_OK;
}
other = ancestor;
} while (ancestor);
other.swap(ancestor);
} while (other);
PRInt32 nodeIdx = nodeAncestors.Count() - 1;
PRInt32 otherIdx = otherAncestors.Count() - 1;

Просмотреть файл

@ -2419,7 +2419,7 @@ isSelfOrAncestor(nsIContent *aNode, nsIContent *aChild)
parent->GetParent(getter_AddRefs(tmpNode));
parent = tmpNode;
parent.swap(tmpNode);
}
return PR_FALSE;