summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-03-30 15:16:07 +0200
committerm-holger <m-holger@kubitscheck.org>2023-04-01 14:57:28 +0200
commit0aae54d3836107fdb9dc54faf0778bf262dd7e0a (patch)
tree4fa3dc74d62d03c760c7b6d614bbe65b1348290d /libqpdf/QPDFObjectHandle.cc
parent5072238867f37f6c6ecd53dab06e42ea2763cf56 (diff)
downloadqpdf-0aae54d3836107fdb9dc54faf0778bf262dd7e0a.tar.zst
Refactor QPDF_Array::setFromVector
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 20be3f9d..c2bc30f0 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -916,11 +916,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item)
void
QPDFObjectHandle::setArrayFromVector(std::vector<QPDFObjectHandle> const& items)
{
- auto array = asArray();
- if (array) {
- for (auto const& item: items) {
- checkOwnership(item);
- }
+ if (auto array = asArray()) {
array->setFromVector(items);
} else {
typeWarning("array", "ignoring attempt to replace items");