Browse Source

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
pull/1640/head
Donat Zenichev 3 years ago
parent
commit
244399eb62
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      daemon/sdp.c

+ 5
- 4
daemon/sdp.c View File

@ -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) {


Loading…
Cancel
Save