[Libosinfo] [RFC PATCH 2/5] osinfo_loader: avoid multiple calls to OSINFO_ENTITY

Giuseppe Scrivano gscrivan at redhat.com
Tue Jun 3 14:08:09 UTC 2014


Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 osinfo/osinfo_loader.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index aa5e48f..a767bb8 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1657,19 +1657,20 @@ osinfo_loader_process_file_reg_ids(OsinfoLoader *loader,
                                             baseURI, vendor_id, device_id);
 
                 OsinfoDevice *dev = osinfo_loader_get_device(loader, id);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                OsinfoEntity *entity = OSINFO_ENTITY(dev);
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_VENDOR_ID,
                                         vendor_id);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_VENDOR,
                                         vendor);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_PRODUCT_ID,
                                         device_id);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_PRODUCT,
                                         device);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_BUS_TYPE,
                                         busType);
                 g_free(id);
-- 
1.9.3




More information about the Libosinfo mailing list