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

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

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use nullptr 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
Index: Source/core/html/parser/HTMLParserIdioms.cpp
diff --git a/Source/core/html/parser/HTMLParserIdioms.cpp b/Source/core/html/parser/HTMLParserIdioms.cpp
index 7650fa88c4bcf46f632c36bed02d1d09e47fe43b..93e29839002557b75ee86ced7eb42a9ea53930ba 100644
--- a/Source/core/html/parser/HTMLParserIdioms.cpp
+++ b/Source/core/html/parser/HTMLParserIdioms.cpp
@@ -325,9 +325,9 @@ WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList& attributes
Mode mode = None;
String charset;
- for (HTMLAttributeList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter) {
- const String& attributeName = iter->first;
- const String& attributeValue = AtomicString(iter->second);
+ for (const auto& htmlAttribute : attributes) {
+ const String& attributeName = htmlAttribute.first;
+ const String& attributeValue = AtomicString(htmlAttribute.second);
if (threadSafeMatch(attributeName, http_equivAttr)) {
if (equalIgnoringCase(attributeValue, "content-type"))
@@ -374,7 +374,7 @@ inline StringImpl* findStringIfStatic(const CharType* characters, unsigned lengt
{
// We don't need to try hashing if we know the string is too long.
if (length > StringImpl::highestStaticStringLength())
- return 0;
+ return nullptr;
// computeHashAndMaskTop8Bits is the function StringImpl::hash() uses.
unsigned hash = StringHasher::computeHashAndMaskTop8Bits(characters, length);
const WTF::StaticStringsTable& table = StringImpl::allStaticStrings();
@@ -382,13 +382,13 @@ inline StringImpl* findStringIfStatic(const CharType* characters, unsigned lengt
WTF::StaticStringsTable::const_iterator it = table.find(hash);
if (it == table.end())
- return 0;
+ return nullptr;
// It's possible to have hash collisions between arbitrary strings and
// known identifiers (e.g. "bvvfg" collides with "script").
// However ASSERTs in StringImpl::createStatic guard against there ever being collisions
// between static strings.
if (!equal(it->value, characters, length))
- return 0;
+ return nullptr;
return it->value;
}

Powered by Google App Engine
This is Rietveld 408576698