Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: Source/core/dom/DatasetDOMStringMap.cpp

Issue 674553002: Move parts of core/dom to C++11 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make Windows shut up when I just try following the style guide Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/ContextLifecycleNotifier.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DatasetDOMStringMap.cpp
diff --git a/Source/core/dom/DatasetDOMStringMap.cpp b/Source/core/dom/DatasetDOMStringMap.cpp
index 56207a854597bf45c6a4a79b075f96bcb587a8e4..89e5dd83d9201db7a7ee4d6625e29ed2a2389077 100644
--- a/Source/core/dom/DatasetDOMStringMap.cpp
+++ b/Source/core/dom/DatasetDOMStringMap.cpp
@@ -155,20 +155,18 @@ void DatasetDOMStringMap::deref()
void DatasetDOMStringMap::getNames(Vector<String>& names)
{
AttributeCollection attributes = m_element->attributes();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
- if (isValidAttributeName(it->localName()))
- names.append(convertAttributeNameToPropertyName(it->localName()));
+ for (const Attribute& attr : attributes) {
+ if (isValidAttributeName(attr.localName()))
+ names.append(convertAttributeNameToPropertyName(attr.localName()));
}
}
String DatasetDOMStringMap::item(const String& name)
{
AttributeCollection attributes = m_element->attributes();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
- if (propertyNameMatchesAttributeName(name, it->localName()))
- return it->value();
+ for (const Attribute& attr : attributes) {
+ if (propertyNameMatchesAttributeName(name, attr.localName()))
+ return attr.value();
}
return String();
@@ -177,9 +175,8 @@ String DatasetDOMStringMap::item(const String& name)
bool DatasetDOMStringMap::contains(const String& name)
{
AttributeCollection attributes = m_element->attributes();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
- if (propertyNameMatchesAttributeName(name, it->localName()))
+ for (const Attribute& attr : attributes) {
+ if (propertyNameMatchesAttributeName(name, attr.localName()))
return true;
}
return false;
« no previous file with comments | « Source/core/dom/ContextLifecycleNotifier.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698