diff options
author | Jay Berkenbilt <ejb@ql.org> | 2020-10-27 15:51:41 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2020-10-27 16:57:48 +0100 |
commit | bcea54fcaa16a7d5feff0c4cd038fea51d1359ea (patch) | |
tree | 2c0dc1076a7963c0d9ac77fc8bb87a57ef7ad964 /include | |
parent | 81d2c548dc619e21519651606970c21f720c8658 (diff) | |
download | qpdf-bcea54fcaa16a7d5feff0c4cd038fea51d1359ea.tar.zst |
Revert removal of unreadCh change for performance
Turns out unreadCh is much more efficient than seek(-1, SEEK_CUR).
Update comments and code to reflect this.
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/InputSource.hh | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/qpdf/InputSource.hh b/include/qpdf/InputSource.hh index 22e3abcd..02254bb3 100644 --- a/include/qpdf/InputSource.hh +++ b/include/qpdf/InputSource.hh @@ -85,14 +85,12 @@ class QPDF_DLL_CLASS InputSource virtual size_t read(char* buffer, size_t length) = 0; // Note: you can only unread the character you just read. The - // specific character is ignored by some implementations. unreadCh - // will be removed from the API in qpdf 11. + // specific character is ignored by some implementations, and the + // implementation doesn't check this. Use of unreadCh is + // semantically equivalent to seek(-1, SEEK_CUR) but is much more + // efficient. virtual void unreadCh(char ch) = 0; - // ABI: delete unreadCh, and direct people to seek backward by 1 - // character instead. - // virtual void unreadCh(char ch) final = delete; - protected: qpdf_offset_t last_offset; |