diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-05-19 10:02:45 -0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-05-19 10:02:45 -0400 |
commit | 596033ec83d1365d7a5df31d28f91347320fe155 (patch) | |
tree | 522933405aa0f0a4eac8b0b103df5c76a9327160 /klm/util/double-conversion | |
parent | 1d96c9c9c521edfca1d10e4d8c5064f79fda3ec5 (diff) |
KenLM 10ddf7d92335 Comment some asserts, update uusage
Diffstat (limited to 'klm/util/double-conversion')
-rw-r--r-- | klm/util/double-conversion/utils.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/klm/util/double-conversion/utils.h b/klm/util/double-conversion/utils.h index 767094b8..2bd71605 100644 --- a/klm/util/double-conversion/utils.h +++ b/klm/util/double-conversion/utils.h @@ -218,7 +218,8 @@ class StringBuilder { // 0-characters; use the Finalize() method to terminate the string // instead. void AddCharacter(char c) { - ASSERT(c != '\0'); + // I just extract raw data not a cstr so null is fine. + //ASSERT(c != '\0'); ASSERT(!is_finalized() && position_ < buffer_.length()); buffer_[position_++] = c; } @@ -233,7 +234,8 @@ class StringBuilder { // builder. The input string must have enough characters. void AddSubstring(const char* s, int n) { ASSERT(!is_finalized() && position_ + n < buffer_.length()); - ASSERT(static_cast<size_t>(n) <= strlen(s)); + // I just extract raw data not a cstr so null is fine. + //ASSERT(static_cast<size_t>(n) <= strlen(s)); memmove(&buffer_[position_], s, n * kCharSize); position_ += n; } @@ -253,7 +255,8 @@ class StringBuilder { buffer_[position_] = '\0'; // Make sure nobody managed to add a 0-character to the // buffer while building the string. - ASSERT(strlen(buffer_.start()) == static_cast<size_t>(position_)); + // I just extract raw data not a cstr so null is fine. + //ASSERT(strlen(buffer_.start()) == static_cast<size_t>(position_)); position_ = -1; ASSERT(is_finalized()); return buffer_.start(); |