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

Unified Diff: src/string-search.h

Issue 5963003: Clean up is-ASCII checks. (Closed)
Patch Set: Created 10 years 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: src/string-search.h
diff --git a/src/string-search.h b/src/string-search.h
index eac84757ecf1d45458133442c5cfc200627cd691..5de3c0951e5d37a1f06d399c4d7919efa5d9019c 100644
--- a/src/string-search.h
+++ b/src/string-search.h
@@ -66,12 +66,7 @@ class StringSearchBase {
}
static inline bool IsAsciiString(Vector<const uc16> string) {
- for (int i = 0, n = string.length(); i < n; i++) {
- if (static_cast<unsigned>(string[i]) > String::kMaxAsciiCharCodeU) {
- return false;
- }
- }
- return true;
+ return String::IsAscii(string.start(), string.length());
}
// The following tables are shared by all searches.
« src/heap.cc ('K') | « src/objects.h ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698