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

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: mike's comments Created 6 years, 1 month 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/html/parser/BackgroundHTMLParser.cpp ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ab999d0aed8d1780fc99be938279a8dd84d752a0 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 HTMLToken::Attribute& attribute : token->attributes())
+ m_attributes.append(Attribute(attemptStaticStringCreation(attribute.name, Likely8Bit), StringImpl::create8BitIfPossible(attribute.value)));
// Fall through!
case HTMLToken::EndTag:
m_selfClosing = token->selfClosing();
@@ -87,15 +87,15 @@ const CompactHTMLToken::Attribute* CompactHTMLToken::getAttributeItem(const Qual
if (threadSafeMatch(m_attributes.at(i).name, name))
return &m_attributes.at(i);
}
- return 0;
+ return nullptr;
}
bool CompactHTMLToken::isSafeToSendToAnotherThread() const
{
- for (Vector<Attribute>::const_iterator it = m_attributes.begin(); it != m_attributes.end(); ++it) {
- if (!it->name.isSafeToSendToAnotherThread())
+ for (const Attribute& attribute : m_attributes) {
+ if (!attribute.name.isSafeToSendToAnotherThread())
return false;
- if (!it->value.isSafeToSendToAnotherThread())
+ if (!attribute.value.isSafeToSendToAnotherThread())
return false;
}
return m_data.isSafeToSendToAnotherThread();
« no previous file with comments | « Source/core/html/parser/BackgroundHTMLParser.cpp ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698