From 4925f0d18c5554bf96d8cb853b5a017e0d18fda2 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 24 Apr 2022 09:05:50 -0400 Subject: Have dictionary/streams mutators take const& where possible --- libqpdf/QPDFObjectHandle.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libqpdf/QPDFObjectHandle.cc') diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 9fadbef3..516e38b9 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1268,7 +1268,8 @@ QPDFObjectHandle::getOwningQPDF() // Dictionary mutators void -QPDFObjectHandle::replaceKey(std::string const& key, QPDFObjectHandle value) +QPDFObjectHandle::replaceKey( + std::string const& key, QPDFObjectHandle const& value) { if (isDictionary()) { checkOwnership(value); @@ -1292,7 +1293,7 @@ QPDFObjectHandle::removeKey(std::string const& key) void QPDFObjectHandle::replaceOrRemoveKey( - std::string const& key, QPDFObjectHandle value) + std::string const& key, QPDFObjectHandle const& value) { if (isDictionary()) { checkOwnership(value); @@ -1334,7 +1335,7 @@ QPDFObjectHandle::isDataModified() } void -QPDFObjectHandle::replaceDict(QPDFObjectHandle new_dict) +QPDFObjectHandle::replaceDict(QPDFObjectHandle const& new_dict) { assertStream(); dynamic_cast(obj.get())->replaceDict(new_dict); -- cgit v1.2.3-70-g09d2