Commit 4b00c90d authored by Albert Astals Cid's avatar Albert Astals Cid

GfxFontDict::hashFontObject1: Remove unnecessary copy calls

parent 063eda5f
...@@ -2479,8 +2479,7 @@ int GfxFontDict::hashFontObject(Object *obj) { ...@@ -2479,8 +2479,7 @@ int GfxFontDict::hashFontObject(Object *obj) {
return h.get31(); return h.get31();
} }
void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) { void GfxFontDict::hashFontObject1(const Object *obj, FNVHash *h) {
Object obj2;
const GooString *s; const GooString *s;
const char *p; const char *p;
double r; double r;
...@@ -2519,7 +2518,7 @@ void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) { ...@@ -2519,7 +2518,7 @@ void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) {
n = obj->arrayGetLength(); n = obj->arrayGetLength();
h->hash((char *)&n, sizeof(int)); h->hash((char *)&n, sizeof(int));
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
obj2 = obj->arrayGetNF(i).copy(); const Object &obj2 = obj->arrayGetNF(i);
hashFontObject1(&obj2, h); hashFontObject1(&obj2, h);
} }
break; break;
...@@ -2530,7 +2529,7 @@ void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) { ...@@ -2530,7 +2529,7 @@ void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) {
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
p = obj->dictGetKey(i); p = obj->dictGetKey(i);
h->hash(p, (int)strlen(p)); h->hash(p, (int)strlen(p));
obj2 = obj->dictGetValNF(i).copy(); const Object &obj2 = obj->dictGetValNF(i);
hashFontObject1(&obj2, h); hashFontObject1(&obj2, h);
} }
break; break;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// All changes made under the Poppler project to this file are licensed // All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2005, 2008, 2015, 2017, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005, 2008, 2015, 2017-2019 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de> // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com> // Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org> // Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
...@@ -456,7 +456,7 @@ public: ...@@ -456,7 +456,7 @@ public:
private: private:
int hashFontObject(Object *obj); int hashFontObject(Object *obj);
void hashFontObject1(Object *obj, FNVHash *h); void hashFontObject1(const Object *obj, FNVHash *h);
GfxFont **fonts; // list of fonts GfxFont **fonts; // list of fonts
int numFonts; // number of fonts int numFonts; // number of fonts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment