[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 35/59] object: avoid extra class property key duplication
From: |
Paolo Bonzini |
Subject: |
[PULL 35/59] object: avoid extra class property key duplication |
Date: |
Thu, 23 Jan 2020 14:50:25 +0100 |
From: Marc-André Lureau <address@hidden>
Like object properties, no need to duplicate property name, as it is
owned already by ObjectProperty value.
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qom/object.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index dcb6863..e921363 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -311,7 +311,7 @@ static void type_initialize(TypeImpl *ti)
memcpy(ti->class, parent->class, parent->class_size);
ti->class->interfaces = NULL;
ti->class->properties = g_hash_table_new_full(
- g_str_hash, g_str_equal, g_free, object_property_free);
+ g_str_hash, g_str_equal, NULL, object_property_free);
for (e = parent->class->interfaces; e; e = e->next) {
InterfaceClass *iface = e->data;
@@ -343,7 +343,7 @@ static void type_initialize(TypeImpl *ti)
}
} else {
ti->class->properties = g_hash_table_new_full(
- g_str_hash, g_str_equal, g_free, object_property_free);
+ g_str_hash, g_str_equal, NULL, object_property_free);
}
ti->class->type = ti;
@@ -1187,7 +1187,7 @@ object_class_property_add(ObjectClass *klass,
prop->release = release;
prop->opaque = opaque;
- g_hash_table_insert(klass->properties, g_strdup(name), prop);
+ g_hash_table_insert(klass->properties, prop->name, prop);
return prop;
}
--
1.8.3.1
- [PULL 25/59] hw/ppc/spapr_rtas: Remove local variable, (continued)
- [PULL 25/59] hw/ppc/spapr_rtas: Remove local variable, Paolo Bonzini, 2020/01/23
- [PULL 26/59] target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported(), Paolo Bonzini, 2020/01/23
- [PULL 27/59] qom/object: Display more helpful message when a parent is missing, Paolo Bonzini, 2020/01/23
- [PULL 28/59] accel: Introduce the current_accel() wrapper, Paolo Bonzini, 2020/01/23
- [PULL 29/59] accel: Replace current_machine->accelerator by current_accel() wrapper, Paolo Bonzini, 2020/01/23
- [PULL 30/59] accel/tcg: Sanitize include path, Paolo Bonzini, 2020/01/23
- [PULL 31/59] object: add extra sanity checks, Paolo Bonzini, 2020/01/23
- [PULL 32/59] qdev: remove duplicated qdev_property_add_static() doc, Paolo Bonzini, 2020/01/23
- [PULL 33/59] qdev: remove extraneous error, Paolo Bonzini, 2020/01/23
- [PULL 34/59] qdev: move helper function to monitor/misc, Paolo Bonzini, 2020/01/23
- [PULL 35/59] object: avoid extra class property key duplication,
Paolo Bonzini <=
- [PULL 36/59] object: add class property initializer, Paolo Bonzini, 2020/01/23
- [PULL 37/59] object: make object_class_property_add* return property, Paolo Bonzini, 2020/01/23
- [PULL 38/59] qstring: add qstring_free(), Paolo Bonzini, 2020/01/23
- [PULL 39/59] object: add object_property_set_default, Paolo Bonzini, 2020/01/23
- [PULL 40/59] object: do not free class properties, Paolo Bonzini, 2020/01/23
- [PULL 41/59] object: check strong flag with &, Paolo Bonzini, 2020/01/23
- [PULL 42/59] object: rename link "child" to "target", Paolo Bonzini, 2020/01/23
- [PULL 43/59] object: add direct link flag, Paolo Bonzini, 2020/01/23
- [PULL 44/59] object: express const link with link property, Paolo Bonzini, 2020/01/23
- [PULL 45/59] object: add object_class_property_add_link(), Paolo Bonzini, 2020/01/23