From 6c923d45f2aaf960806429d36ca58a41b3a39740 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Wed, 9 Mar 2011 13:40:23 -0500 Subject: kenlm sync --- klm/util/file_piece.hh | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'klm/util/file_piece.hh') diff --git a/klm/util/file_piece.hh b/klm/util/file_piece.hh index f5249fcf..870ae5a3 100644 --- a/klm/util/file_piece.hh +++ b/klm/util/file_piece.hh @@ -3,6 +3,7 @@ #include "util/ersatz_progress.hh" #include "util/exception.hh" +#include "util/have.hh" #include "util/mmap.hh" #include "util/scoped.hh" #include "util/string_piece.hh" @@ -11,8 +12,6 @@ #include -#define HAVE_ZLIB - namespace util { class EndOfFileException : public Exception { @@ -100,19 +99,7 @@ class FilePiece { return ret; } - const char *FindDelimiterOrEOF(const bool *delim = kSpaces) throw (GZException, EndOfFileException) { - for (const char *i = position_; i < position_end_; ++i) { - if (delim[static_cast(*i)]) return i; - } - while (!at_end_) { - size_t skip = position_end_ - position_; - Shift(); - for (const char *i = position_ + skip; i < position_end_; ++i) { - if (delim[static_cast(*i)]) return i; - } - } - return position_end_; - } + const char *FindDelimiterOrEOF(const bool *delim = kSpaces) throw (GZException, EndOfFileException); void Shift() throw (EndOfFileException, GZException); // Backends to Shift(). -- cgit v1.2.3