[gimp] libgimpconfig: cache the "gegl-property-keys" Quark
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpconfig: cache the "gegl-property-keys" Quark
- Date: Wed, 17 Jun 2020 19:57:00 +0000 (UTC)
commit 896286279be3c2a86ebfff220a089c8963bad2bf
Author: Michael Natterer <mitch gimp org>
Date: Fri Jun 12 16:52:26 2020 +0200
libgimpconfig: cache the "gegl-property-keys" Quark
in gimp_config_param_spec_duplicate().
libgimpconfig/gimpconfig-params.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libgimpconfig/gimpconfig-params.c b/libgimpconfig/gimpconfig-params.c
index 62c9103bfd..ee85eb8910 100644
--- a/libgimpconfig/gimpconfig-params.c
+++ b/libgimpconfig/gimpconfig-params.c
@@ -343,8 +343,13 @@ gimp_config_param_spec_duplicate (GParamSpec *pspec)
if (copy)
{
- GQuark quark = g_quark_from_static_string ("gegl-property-keys");
- GHashTable *keys = g_param_spec_get_qdata (pspec, quark);
+ GQuark quark = 0;
+ GHashTable *keys;
+
+ if (G_UNLIKELY (! quark))
+ quark = g_quark_from_static_string ("gegl-property-keys");
+
+ keys = g_param_spec_get_qdata (pspec, quark);
if (keys)
g_param_spec_set_qdata_full (copy, quark, g_hash_table_ref (keys),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]