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

Unified Diff: core/fxcrt/cfx_string_data_template.h

Issue 2640143003: Update safe numerics package to get bitwise ops (Closed)
Patch Set: 0 is a perfectly fine value of zero Created 3 years, 11 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
Index: core/fxcrt/cfx_string_data_template.h
diff --git a/core/fxcrt/cfx_string_data_template.h b/core/fxcrt/cfx_string_data_template.h
index affd61001198f13f83ccb8a582b3d8cb5ac1d726..c3e090fef0c8431aa54467c77ae1bc996521db9a 100644
--- a/core/fxcrt/cfx_string_data_template.h
+++ b/core/fxcrt/cfx_string_data_template.h
@@ -30,7 +30,8 @@ class CFX_StringDataTemplate {
// where we can save a re-alloc when adding a few characters to a string
// by using this otherwise wasted space.
nSize += 7;
- int totalSize = nSize.ValueOrDie() & ~7;
+ nSize &= ~7;
+ int totalSize = nSize.ValueOrDie();
int usableLen = (totalSize - overhead) / sizeof(CharType);
ASSERT(usableLen >= nLen);

Powered by Google App Engine
This is Rietveld 408576698