fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sccp/+/36086?usp=email )
Change subject: cosmetic: reduce nesting in osmo_ss7_as_find_by_proto()
......................................................................
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(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/86/36086/1
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
https://gerrit.osmocom.org/c/libosmo-sccp/+/36086?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I16e460b91f57bea6606c111335257d717d5423d0
Gerrit-Change-Number: 36086
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange