From 244399eb62b2395cca5dba520999ffb417af502b Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 14 Mar 2023 08:46:00 +0100 Subject: [PATCH] MT#56128 SDP manipulations: improve efficiency of `sdp_manipulate_check` Improve an efficiency of the code in terms of not checking anything inside the function, if the `sdp_manipulation` flags are absent. Change-Id: I2a5d8cf675a73ec7a2b4af94d5c7fe2f18fc1772 --- daemon/sdp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 1a1ecb99a..56fed54a9 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -306,6 +306,11 @@ static int sdp_manipulate_subst_cmp(gconstpointer a, gconstpointer b) { static int sdp_manipulate_check(enum command_type command_type, struct sdp_manipulations_common * sdp_manipulations, enum media_type media_type, str * attr_name) { + + /* no need for checks, if not given in flags */ + if (!sdp_manipulations) + return 0; + /* for now we only support session lvl, audio and media streams */ if (media_type == MT_OTHER) { @@ -314,10 +319,6 @@ static int sdp_manipulate_check(enum command_type command_type, return 0; } - /* no need for checks, if not given in flags */ - if (!sdp_manipulations) - return 0; - GQueue * q_ptr = NULL; switch (command_type) {