Browse code

dlgs: optimize dlgs_init, if/else path are identical

(cherry picked from commit 8e7f2e6a158bb2c59600b03be3c7e6eefc416180)

Henning Westerholt authored on 17/12/2021 12:53:37 • Daniel-Constantin Mierla committed on 26/01/2022 12:33:51
Showing 1 changed files
... ...
@@ -174,11 +174,7 @@ static int ki_dlgs_init(sip_msg_t *msg, str *src, str *dst, str *data)
174 174
 
175 175
 	if(msg->first_line.type == SIP_REQUEST) {
176 176
 		rtype = SIP_REQUEST;
177
-		if(msg->first_line.u.request.method_value == METHOD_INVITE) {
178
-			rmethod = METHOD_INVITE;
179
-		} else {
180
-			rmethod = msg->first_line.u.request.method_value;
181
-		}
177
+		rmethod = msg->first_line.u.request.method_value;
182 178
 	} else {
183 179
 		rtype = SIP_REPLY;
184 180
 		if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) ||