diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-09-09 21:40:02 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-09-10 00:09:40 +0200 |
commit | 8a3cdfd2af4a95d8daede45bcb36eecdcdc8f964 (patch) | |
tree | eca67c2673499f731138ded8b88b84afa83ef6aa /libqpdf | |
parent | 910a373a79f885cba1023fa69aa0c679e4ae0601 (diff) | |
download | qpdf-8a3cdfd2af4a95d8daede45bcb36eecdcdc8f964.tar.zst |
Change QPDFObjectHandle == to isSameObjectAs
Replace operator== and operator!=, which were testing for the same
underlying object, with isSameObjectAs. This change was motivated by
the fact that pikepdf internally had its own operator== method for
QPDFObjectHandle that did structural comparison. I backed out qpdf's
operator== as a courtesy to pikepdf (in my own testing) but also
because I think people might naturally assume that operator== does a
structural comparison, and isSameObjectAs is clearer in its intent.
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 6225dba9..c52ac2fc 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -237,17 +237,11 @@ LastChar::getLastChar() } bool -QPDFObjectHandle::operator==(QPDFObjectHandle const& rhs) const +QPDFObjectHandle::isSameObjectAs(QPDFObjectHandle const& rhs) const { return this->obj == rhs.obj; } -bool -QPDFObjectHandle::operator!=(QPDFObjectHandle const& rhs) const -{ - return this->obj != rhs.obj; -} - void QPDFObjectHandle::disconnect() { |