Simplify the code in this function

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2009-09-07 11:31:19 +00:00
parent 4596fdb788
commit 109cab6862
+13 -12
View File
@@ -23198,20 +23198,21 @@ int st_get_se(struct sip_pvt *p, int max)
}
p->stimer->st_cached_max_se = global_max_se;
return (p->stimer->st_cached_max_se);
} else {
if (p->stimer->st_cached_min_se) {
return p->stimer->st_cached_min_se;
} else if (p->peername) {
struct sip_peer *pp = find_peer(p->peername, NULL, TRUE, FINDPEERS, FALSE, 0);
if (pp) {
p->stimer->st_cached_min_se = pp->stimer.st_min_se;
unref_peer(pp, "unref peer pointer from find_peer call in st_get_se (2)");
return (p->stimer->st_cached_min_se);
}
}
/* Find Min SE timer */
if (p->stimer->st_cached_min_se) {
return p->stimer->st_cached_min_se;
}
if (p->peername) {
struct sip_peer *pp = find_peer(p->peername, NULL, TRUE, FINDPEERS, FALSE, 0);
if (pp) {
p->stimer->st_cached_min_se = pp->stimer.st_min_se;
unref_peer(pp, "unref peer pointer from find_peer call in st_get_se (2)");
return (p->stimer->st_cached_min_se);
}
p->stimer->st_cached_min_se = global_min_se;
return (p->stimer->st_cached_min_se);
}
p->stimer->st_cached_min_se = global_min_se;
return (p->stimer->st_cached_min_se);
}