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

Unified Diff: net/base/escape.cc

Issue 662553002: Convert ARRAYSIZE_UNSAFE -> arraysize in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « net/base/address_list_unittest.cc ('k') | net/base/filename_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/escape.cc
diff --git a/net/base/escape.cc b/net/base/escape.cc
index 7ce21a1ac9b14396ca901c6fb6f840dde4d5ceb1..1798b6cae9a5ad73bc8891a31b8350558dff8e69 100644
--- a/net/base/escape.cc
+++ b/net/base/escape.cc
@@ -244,7 +244,7 @@ void AppendEscapedCharForHTMLImpl(typename str::value_type c, str* output) {
{ '\'', "'" },
};
size_t k;
- for (k = 0; k < ARRAYSIZE_UNSAFE(kCharsToEscape); ++k) {
+ for (k = 0; k < arraysize(kCharsToEscape); ++k) {
if (c == kCharsToEscape[k].key) {
const char* p = kCharsToEscape[k].replacement;
while (*p)
@@ -252,7 +252,7 @@ void AppendEscapedCharForHTMLImpl(typename str::value_type c, str* output) {
break;
}
}
- if (k == ARRAYSIZE_UNSAFE(kCharsToEscape))
+ if (k == arraysize(kCharsToEscape))
output->push_back(c);
}
@@ -385,14 +385,14 @@ base::string16 UnescapeForHTML(const base::string16& input) {
if (input.find(base::ASCIIToUTF16("&")) == std::string::npos)
return input;
- base::string16 ampersand_chars[ARRAYSIZE_UNSAFE(kEscapeToChars)];
+ base::string16 ampersand_chars[arraysize(kEscapeToChars)];
base::string16 text(input);
for (base::string16::iterator iter = text.begin();
iter != text.end(); ++iter) {
if (*iter == '&') {
// Potential ampersand encode char.
size_t index = iter - text.begin();
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kEscapeToChars); i++) {
+ for (size_t i = 0; i < arraysize(kEscapeToChars); i++) {
if (ampersand_chars[i].empty()) {
ampersand_chars[i] =
base::ASCIIToUTF16(kEscapeToChars[i].ampersand_code);
« no previous file with comments | « net/base/address_list_unittest.cc ('k') | net/base/filename_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698