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

Unified Diff: base/strings/string16.cc

Issue 2690603002: format test
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string16.cc
diff --git a/base/strings/string16.cc b/base/strings/string16.cc
index f4c8cf74607de0ecf3a609909d957c6f9630a6c2..7e6588384edf177145be7e3fb8b648fdc6e0f1c6 100644
--- a/base/strings/string16.cc
+++ b/base/strings/string16.cc
@@ -20,16 +20,7 @@
namespace base {
int c16memcmp(const char16* s1, const char16* s2, size_t n) {
- // We cannot call memcmp because that changes the semantics.
- while (n-- > 0) {
- if (*s1 != *s2) {
- // We cannot use (*s1 - *s2) because char16 is unsigned.
- return ((*s1 < *s2) ? -1 : 1);
- }
- ++s1;
- ++s2;
- }
- return 0;
+ while (n-- > 0) { if (*s1 != *s2) { return ((*s1 < *s2) ? -1 : 1); } ++s1; ++s2; } return 0;
}
size_t c16len(const char16* s) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698