Skip to contentSkip to conversation

object_new_with_type: remove redundant code

PATCH In review Cao jin 1 participant 2 messages Nov 5, 2015

lore
Share & tools
lore

Cao jin

author
#0 lore raw

PATCH 1/1 object_new_with_type: remove redundant code

g_assert & type_initialize are called in object_initialize_with_type

---
 qom/object.c | 3 ---
 1 file changed, 3 deletions(-)
qom/object.c +0 -3
index fc6e161..43ac2dd 100644
@@ -423,9 +423,6 @@ Object *object_new_with_type(Type type)
 {
     Object *obj;
 
-    g_assert(type != NULL);
-    type_initialize(type);
-
     obj = g_malloc(type->instance_size);
     object_initialize_with_type(obj, type->instance_size, type);
     obj->free = g_free;
Signature · 1 line
2.1.0
author
#1 lore raw

sorry for this, I am wrong at removing type_initialize. please forget it

Quoted 22 lines · Cao jin

g_assert & type_initialize are called in object_initialize_with_type

---
  qom/object.c | 3 ---
  1 file changed, 3 deletions(-)
qom/object.c +0 -3
index fc6e161..43ac2dd 100644
@@ -423,9 +423,6 @@ Object *object_new_with_type(Type type)
  {
      Object *obj;
 
-    g_assert(type != NULL);
-    type_initialize(type);
-
      obj = g_malloc(type->instance_size);
      object_initialize_with_type(obj, type->instance_size, type);
      obj->free = g_free;
Signature · 3 lines
Yours Sincerely,

Cao Jin