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

Unified Diff: Source/core/html/parser/CompactHTMLToken.cpp

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use meaningful names 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
Index: Source/core/html/parser/CompactHTMLToken.cpp
diff --git a/Source/core/html/parser/CompactHTMLToken.cpp b/Source/core/html/parser/CompactHTMLToken.cpp
index ea04f824ab71e664be3dccd663ee5e67eb623026..317a366c93d67ae208dcee241bfdff0b8cf989f0 100644
--- a/Source/core/html/parser/CompactHTMLToken.cpp
+++ b/Source/core/html/parser/CompactHTMLToken.cpp
@@ -63,8 +63,8 @@ CompactHTMLToken::CompactHTMLToken(const HTMLToken* token, const TextPosition& t
break;
case HTMLToken::StartTag:
m_attributes.reserveInitialCapacity(token->attributes().size());
- for (Vector<HTMLToken::Attribute>::const_iterator it = token->attributes().begin(); it != token->attributes().end(); ++it)
- m_attributes.append(Attribute(attemptStaticStringCreation(it->name, Likely8Bit), StringImpl::create8BitIfPossible(it->value)));
+ for (const auto& attribute : token->attributes())
+ m_attributes.append(Attribute(attemptStaticStringCreation(attribute.name, Likely8Bit), StringImpl::create8BitIfPossible(attribute.value)));
// Fall through!
case HTMLToken::EndTag:
m_selfClosing = token->selfClosing();
@@ -92,10 +92,10 @@ const CompactHTMLToken::Attribute* CompactHTMLToken::getAttributeItem(const Qual
bool CompactHTMLToken::isSafeToSendToAnotherThread() const
{
- for (Vector<Attribute>::const_iterator it = m_attributes.begin(); it != m_attributes.end(); ++it) {
- if (!it->name.isSafeToSendToAnotherThread())
+ for (const auto& attribute : m_attributes) {
+ if (!attribute.name.isSafeToSendToAnotherThread())
return false;
- if (!it->value.isSafeToSendToAnotherThread())
+ if (!attribute.value.isSafeToSendToAnotherThread())
return false;
}
return m_data.isSafeToSendToAnotherThread();

Powered by Google App Engine
This is Rietveld 408576698