diff options
author | cjihrig <cjihrig@gmail.com> | 2018-12-24 12:10:35 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-12-26 12:25:19 -0500 |
commit | c2b4269b77822aee6d07ae427a3341abdbaa8c3f (patch) | |
tree | bdd52c57636e5d5d5fa9836599886551c267a947 /src/string_decoder.cc | |
parent | e01999db14034cb56625f40493d47b339da99048 (diff) | |
download | android-node-v8-c2b4269b77822aee6d07ae427a3341abdbaa8c3f.tar.gz android-node-v8-c2b4269b77822aee6d07ae427a3341abdbaa8c3f.tar.bz2 android-node-v8-c2b4269b77822aee6d07ae427a3341abdbaa8c3f.zip |
src: use DCHECK_* macros where possible
PR-URL: https://github.com/nodejs/node/pull/25207
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'src/string_decoder.cc')
-rw-r--r-- | src/string_decoder.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/string_decoder.cc b/src/string_decoder.cc index a83d6623b4..96c6baa4d8 100644 --- a/src/string_decoder.cc +++ b/src/string_decoder.cc @@ -123,11 +123,9 @@ MaybeLocal<String> StringDecoder::DecodeData(Isolate* isolate, body = !prepend.IsEmpty() ? prepend : String::Empty(isolate); prepend = Local<String>(); } else { -#ifdef DEBUG // If not, that means is no character left to finish at this point. - CHECK_EQ(MissingBytes(), 0); - CHECK_EQ(BufferedBytes(), 0); -#endif + DCHECK_EQ(MissingBytes(), 0); + DCHECK_EQ(BufferedBytes(), 0); // See whether there is a character that we may have to cut off and // finish when receiving the next chunk. @@ -136,9 +134,7 @@ MaybeLocal<String> StringDecoder::DecodeData(Isolate* isolate, // This means we'll need to figure out where the character to which // the byte belongs begins. for (size_t i = nread - 1; ; --i) { -#ifdef DEBUG - CHECK_LT(i, nread); -#endif + DCHECK_LT(i, nread); state_[kBufferedBytes]++; if ((data[i] & 0xC0) == 0x80) { // This byte does not start a character (a "trailing" byte). |