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

Unified Diff: base/strings/safe_sprintf.cc

Issue 642263006: Remove trivially-true DEBUG_CHECKs in safe_sprintf.cc (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 | « 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/safe_sprintf.cc
diff --git a/base/strings/safe_sprintf.cc b/base/strings/safe_sprintf.cc
index 1c927184658559d1bc238578e3918474da755de4..5b575635519265bee696fde37e780b08b0e2118f 100644
--- a/base/strings/safe_sprintf.cc
+++ b/base/strings/safe_sprintf.cc
@@ -176,8 +176,7 @@ class Buffer {
// overflowed |size_|) at any time during padding.
inline bool Pad(char pad, size_t padding, size_t len) {
DEBUG_CHECK(pad);
- DEBUG_CHECK(padding >= 0 && padding <= kSSizeMax);
- DEBUG_CHECK(len >= 0);
+ DEBUG_CHECK(padding <= kSSizeMax);
for (; padding > len; --padding) {
if (!Out(pad)) {
if (--padding) {
@@ -283,7 +282,6 @@ bool Buffer::IToASCII(bool sign, bool upcase, int64_t i, int base,
DEBUG_CHECK(base <= 16);
DEBUG_CHECK(!sign || base == 10);
DEBUG_CHECK(pad == '0' || pad == ' ');
- DEBUG_CHECK(padding >= 0);
DEBUG_CHECK(padding <= kSSizeMax);
DEBUG_CHECK(!(sign && prefix && *prefix));
« 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