Test RTC_DCHECK_IS_ON instead of checking DCHECK_ALWAYS_ON everywhere
The former is always defined (by webrtc/base/checks.h) to either 0 or
1, whereas the latter isn't necessarily defined.
This is a re-land of https://codereview.webrtc.org/2384693002, which
broke Chromium. We re-land without changing this CL at all, because
the thing that needed fixing was in Chromium:
https://codereview.chromium.org/2384263004.
NOTRY=true
TBR=ossu@webrtc.org
BUG=webrtc:6451
Review-Url: https://codereview.webrtc.org/2389943003
Cr-Commit-Position: refs/heads/master@{#14508}
diff --git a/webrtc/base/stringutils.cc b/webrtc/base/stringutils.cc
index 9580253..48830e4 100644
--- a/webrtc/base/stringutils.cc
+++ b/webrtc/base/stringutils.cc
@@ -77,7 +77,7 @@
} else if (srclen >= buflen) {
srclen = buflen - 1;
}
-#if !defined(NDEBUG)
+#if RTC_DCHECK_IS_ON
// Double check that characters are not UTF-8
for (size_t pos = 0; pos < srclen; ++pos)
RTC_DCHECK_LT(static_cast<unsigned char>(source[pos]), 128);