From baa617e446be54dc1dda4231a92f4752d4d5c7c9 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 27 Mar 2023 14:23:45 -0400 Subject: [PATCH] MT#56447 simplify handle removal No need to do the key lookup twice. Change-Id: Icb940d456656829d8c804773235d7ec20b76df65 --- daemon/janus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/daemon/janus.c b/daemon/janus.c index c5152ee33..d6aedad8f 100644 --- a/daemon/janus.c +++ b/daemon/janus.c @@ -1329,13 +1329,11 @@ const char *janus_detach(struct websocket_message *wm, JsonReader *reader, JsonB { LOCK(&session->lock); - void *exists = g_hash_table_lookup(session->handles, &handle_id); + bool exists = g_hash_table_remove(session->handles, &handle_id); *retcode = 463; if (!exists) return "Could not detach handle from plugin"; - - g_hash_table_remove(session->handles, &handle_id); } LOCK(&janus_lock);