diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2024-02-27 00:21:27 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2024-02-27 00:33:45 +0700 |
commit | ad9af625e52b8f882b2552b03cb0239198442d6a (patch) | |
tree | f16e8509980493a6398e5b0ccb690557a9fa7469 | |
parent | 285800966fe04fdb19b1ff288471269bc98eb581 (diff) |
cosmetic: reduce nesting in osmo_ss7_as_find_by_proto()
Change-Id: I16e460b91f57bea6606c111335257d717d5423d0
Related: SYS#5424
-rw-r--r-- | src/osmo_ss7.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index dbbef6b..dadb68e 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -915,18 +915,17 @@ struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, /* Loop through the list with AS and try to find one where the proto matches up */ llist_for_each_entry(as, &inst->as_list, list) { - if (as->cfg.proto == proto) { + if (as->cfg.proto != proto) + continue; - /* Put down the first AS that matches the proto, just in - * case we will not find any matching ASP */ - if (!as_without_asp) - as_without_asp = as; + /* Put down the first AS that matches the proto, just in + * case we will not find any matching ASP */ + if (!as_without_asp) + as_without_asp = as; - /* Check if the candicate we have here has any suitable - * ASP */ - if (osmo_ss7_asp_find_by_proto(as, proto)) - return as; - } + /* Check if the candicate we have here has any suitable ASP */ + if (osmo_ss7_asp_find_by_proto(as, proto)) + return as; } /* Return with the second best find, if there is any */ |