[sr-dev] git:master:cbe6cef5: keepalive: removed redundant checks

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 11 10:24:48 CEST 2022


Module: kamailio
Branch: master
Commit: cbe6cef58da8de7efa18c4e34458a81176d23e42
URL: https://github.com/kamailio/kamailio/commit/cbe6cef58da8de7efa18c4e34458a81176d23e42

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-10-11T10:17:34+02:00

keepalive: removed redundant checks

---

Modified: src/modules/keepalive/keepalive_api.c

---

Diff:  https://github.com/kamailio/kamailio/commit/cbe6cef58da8de7efa18c4e34458a81176d23e42.diff
Patch: https://github.com/kamailio/kamailio/commit/cbe6cef58da8de7efa18c4e34458a81176d23e42.patch

---

diff --git a/src/modules/keepalive/keepalive_api.c b/src/modules/keepalive/keepalive_api.c
index d68e97e374b..e8b1e044be8 100644
--- a/src/modules/keepalive/keepalive_api.c
+++ b/src/modules/keepalive/keepalive_api.c
@@ -224,10 +224,7 @@ int ka_find_destination(str *uri, str *owner, ka_dest_t **target, ka_dest_t **he
 	ka_dest_t  *dest=0 ,*temp=0;
 	LM_DBG("finding destination: %.*s\n", uri->len, uri->s);
 
-	for(dest = ka_destinations_list->first ;dest; temp=dest, dest= dest->next ){
-		if(!dest)
-			break;
-
+	for(dest = ka_destinations_list->first; dest; temp=dest, dest=dest->next) {
 		if (STR_EQ(*uri, dest->uri) && STR_EQ(*owner, dest->owner)){
 			*head = temp;
 			*target = dest;
@@ -255,10 +252,7 @@ int ka_find_destination_by_uuid(str uuid, ka_dest_t **target, ka_dest_t **head){
 
 	LM_DBG("finding destination with uuid:%.*s\n", uuid.len, uuid.s);
 
-	for(dest = ka_destinations_list->first ;dest ; temp = dest, dest = dest->next ){
-		if(!dest)
-			break;
-
+	for(dest = ka_destinations_list->first; dest; temp = dest, dest = dest->next) {
 		if (STR_EQ(uuid, dest->uuid)){
 			*head = temp;
 			*target = dest;




More information about the sr-dev mailing list