summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-02-27 13:56:23 +0100
committerAlbert Astals Cid <aacid@kde.org>2019-02-27 14:01:29 +0100
commit597e26e96d2a1449aea360e2cf6ffcbf4b8f5b1d (patch)
treedf0a9df2c0603fc5b2d7bacad8ed8c46a9ff57d5 /glib
parent0a4e86e804b784b497407cc9e82cb109ed19edbf (diff)
Make Annot::getNF and Dict::getNF return const & instead of copy
Lots of users can deal with a const & directly, so it saves us some copying. For the ones that can't move the copy to the caller side. Some of copy() on the caller side can be easily removed, that will come on next commits
Diffstat (limited to 'glib')
-rw-r--r--glib/poppler-document.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index ed37da4c..38699e2f 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -2845,7 +2845,7 @@ get_optional_content_rbgroups (OCGs *ocg)
for (j = 0; j < rb_array->getLength (); ++j) {
OptionalContentGroup *oc;
- Object ref = rb_array->getNF (j);
+ const Object &ref = rb_array->getNF (j);
if (!ref.isRef ()) {
continue;
}
@@ -2888,7 +2888,7 @@ get_optional_content_items_sorted (OCGs *ocg, Layer *parent, Array *order)
Object orderItem = order->get (i);
if (orderItem.isDict ()) {
- Object ref = order->getNF (i);
+ const Object &ref = order->getNF (i);
if (ref.isRef ()) {
OptionalContentGroup *oc = ocg->findOcgByRef (ref.getRef ());
Layer *layer = layer_new (oc);