summaryrefslogtreecommitdiff
path: root/test
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 /test
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 'test')
-rw-r--r--test/pdf-fullrewrite.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/pdf-fullrewrite.cc b/test/pdf-fullrewrite.cc
index 94f39b3c..d9b8ac3e 100644
--- a/test/pdf-fullrewrite.cc
+++ b/test/pdf-fullrewrite.cc
@@ -125,8 +125,8 @@ static bool compareDictionaries(Dict *dictA, Dict *dictB)
* in dictB is also contained in dictA */
for (int i = 0; i < length; ++i) {
const char *key = dictA->getKey(i);
- Object valA = dictA->getValNF(i);
- Object valB = dictB->lookupNF(key);
+ Object valA = dictA->getValNF(i).copy();
+ Object valB = dictB->lookupNF(key).copy();
if (!compareObjects(&valA, &valB))
return false;
}
@@ -197,8 +197,8 @@ static bool compareObjects(Object *objA, Object *objB)
return false;
} else {
for (int i = 0; i < length; ++i) {
- Object elemA = arrayA->getNF(i);
- Object elemB = arrayB->getNF(i);
+ Object elemA = arrayA->getNF(i).copy();
+ Object elemB = arrayB->getNF(i).copy();
if (!compareObjects(&elemA, &elemB)) {
return false;
}