fixeria submitted this change.
cosmetic: reduce nesting in osmo_ss7_as_find_by_proto()
Change-Id: I16e460b91f57bea6606c111335257d717d5423d0
Related: SYS#5424
---
M src/osmo_ss7.c
1 file changed, 19 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 @@
/* 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 */
To view, visit change 36086. To unsubscribe, or for help writing mail filters, visit settings.