diff options
author | Albert Astals Cid <aacid@kde.org> | 2019-02-27 13:56:23 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2019-02-27 14:01:29 +0100 |
commit | 597e26e96d2a1449aea360e2cf6ffcbf4b8f5b1d (patch) | |
tree | df0a9df2c0603fc5b2d7bacad8ed8c46a9ff57d5 /poppler/Gfx.cc | |
parent | 0a4e86e804b784b497407cc9e82cb109ed19edbf (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 'poppler/Gfx.cc')
-rw-r--r-- | poppler/Gfx.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index d9460f2f..c80786e7 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -1241,7 +1241,7 @@ void Gfx::opSetExtGState(Object args[], int numArgs) { if (obj2.isArray()) { GfxFont *font; if (obj2.arrayGetLength() == 2) { - Object fargs0 = obj2.arrayGetNF(0); + const Object &fargs0 = obj2.arrayGetNF(0); Object fargs1 = obj2.arrayGet(1); if (fargs0.isRef() && fargs1.isNum()) { Object fobj = fargs0.fetch(xref); @@ -1277,7 +1277,7 @@ void Gfx::opSetExtGState(Object args[], int numArgs) { if (obj2.arrayGetLength() == 2) { Object dargs[2]; - dargs[0] = obj2.arrayGetNF(0); + dargs[0] = obj2.arrayGetNF(0).copy(); dargs[1] = obj2.arrayGet(1); if (dargs[0].isArray() && dargs[1].isInt()) { opSetDash(dargs,2); |