diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-01-22 21:37:49 +0000 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-01-22 21:37:49 +0000 |
commit | b35a7f3a96ff8ae42e15922dd6949bf9f5d15501 (patch) | |
tree | 26edbe78931ffc50864a899c087d851005fe560b /klm/util/string_piece.cc | |
parent | 51a412aa7f5f50035cf28a274a70508c839f3d40 (diff) |
KenLM 58da338b
Diffstat (limited to 'klm/util/string_piece.cc')
-rw-r--r-- | klm/util/string_piece.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/klm/util/string_piece.cc b/klm/util/string_piece.cc index b422cefc..ec394b96 100644 --- a/klm/util/string_piece.cc +++ b/klm/util/string_piece.cc @@ -17,7 +17,8 @@ void StringPiece::CopyToString(std::string* target) const { } size_type StringPiece::find(const StringPiece& s, size_type pos) const { - if (length_ < 0 || pos > static_cast<size_type>(length_)) + // Not sure why length_ < 0 was here since it's std::size_t. + if (/*length_ < 0 || */pos > static_cast<size_type>(length_)) return npos; const char* result = std::search(ptr_ + pos, ptr_ + length_, |