Index: Source/core/dom/Element.cpp |
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
index d7d1695d4bb43b3500db8b05a4d4bc42d6c90aa5..db7ace97e2c10869333f046d87afa13bb59f4c0a 100644 |
--- a/Source/core/dom/Element.cpp |
+++ b/Source/core/dom/Element.cpp |
@@ -178,11 +178,12 @@ static void removeAttrNodeListForElement(Element* element) |
element->setHasSyntheticAttrChildNodes(false); |
} |
-static Attr* findAttrNodeInList(AttrNodeList& attrNodeList, const QualifiedName& name) |
+static Attr* findAttrNodeInList(const AttrNodeList& attrNodeList, const QualifiedName& name) |
{ |
- for (unsigned i = 0; i < attrNodeList.size(); ++i) { |
- if (attrNodeList[i]->qualifiedName() == name) |
- return attrNodeList[i].get(); |
+ AttrNodeList::const_iterator end = attrNodeList.end(); |
+ for (AttrNodeList::const_iterator it = attrNodeList.begin(); it != end; ++it) { |
+ if ((*it)->qualifiedName() == name) |
eseidel
2013/11/06 03:12:24
I wonder if this really wants matches() :) Which
|
+ return it->get(); |
} |
return 0; |
} |
@@ -923,12 +924,13 @@ inline void Element::setAttributeInternal(size_t index, const QualifiedName& nam |
return; |
} |
- QualifiedName existingAttributeName = attributeItem(index)->name(); |
+ const Attribute* existingAttribute = attributeItem(index); |
+ QualifiedName existingAttributeName = existingAttribute->name(); |
if (!inSynchronizationOfLazyAttribute) |
- willModifyAttribute(existingAttributeName, attributeItem(index)->value(), newValue); |
+ willModifyAttribute(existingAttributeName, existingAttribute->value(), newValue); |
- if (newValue != attributeItem(index)->value()) { |
+ if (newValue != existingAttribute->value()) { |
// If there is an Attr node hooked to this attribute, the Attr::setValue() call below |
// will write into the ElementData. |
// FIXME: Refactor this so it makes some sense. |