From 8a3cdfd2af4a95d8daede45bcb36eecdcdc8f964 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 9 Sep 2022 15:40:02 -0400 Subject: 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. --- libqpdf/QPDFObjectHandle.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'libqpdf') 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() { -- cgit v1.2.3-54-g00ecf