Skip to content
Snippets Groups Projects
Commit 90629122 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Paolo Bonzini
Browse files

module: use g_hash_table_add()


The hashtable is used like a set, use the convenience
g_hash_table_add() function.

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c932ce31
No related branches found
No related tags found
No related merge requests found
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment