summaryrefslogtreecommitdiff
path: root/klm/util/file_piece.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/util/file_piece.hh')
-rw-r--r--klm/util/file_piece.hh17
1 files changed, 2 insertions, 15 deletions
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 <cstddef>
-#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<unsigned char>(*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<unsigned char>(*i)]) return i;
- }
- }
- return position_end_;
- }
+ const char *FindDelimiterOrEOF(const bool *delim = kSpaces) throw (GZException, EndOfFileException);
void Shift() throw (EndOfFileException, GZException);
// Backends to Shift().