[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] module: use g_hash_table_add()
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 1/3] module: use g_hash_table_add() |
Date: |
Tue, 6 Aug 2019 09:11:04 +0200 |
From: Marc-André Lureau <address@hidden>
The hashtable is used like a set, use the convenience
g_hash_table_add() function.
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
util/module.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/util/module.c b/util/module.c
index 142db7e..ca9885c 100644
--- a/util/module.c
+++ b/util/module.c
@@ -179,11 +179,10 @@ void module_load_one(const char *prefix, const char
*lib_name)
module_name = g_strdup_printf("%s%s", prefix, lib_name);
- if (g_hash_table_lookup(loaded_modules, module_name)) {
+ if (!g_hash_table_add(loaded_modules, module_name)) {
g_free(module_name);
return;
}
- g_hash_table_insert(loaded_modules, module_name, module_name);
exec_dir = qemu_get_exec_dir();
search_dir = getenv("QEMU_MODULE_DIR");
--
1.8.3.1