Browse Source

Sever: Cosmetic improvements

Julius Pfrommer 5 years ago
parent
commit
daf078958c
1 changed files with 6 additions and 9 deletions
  1. 6 9
      src/server/ua_server.c

+ 6 - 9
src/server/ua_server.c

@@ -78,16 +78,13 @@ UA_Server_getConfig(UA_Server *server)
 UA_StatusCode
 UA_Server_getNamespaceByName(UA_Server *server, const UA_String namespaceUri,
                              size_t* foundIndex) {
-  for(size_t idx = 0; idx < server->namespacesSize; idx++)
-  {
-    if(UA_String_equal(&server->namespaces[idx], &namespaceUri) == true)
-    {
-      (*foundIndex) = idx;
-      return UA_STATUSCODE_GOOD;
+    for(size_t idx = 0; idx < server->namespacesSize; idx++) {
+        if(!UA_String_equal(&server->namespaces[idx], &namespaceUri))
+            continue;
+        (*foundIndex) = idx;
+        return UA_STATUSCODE_GOOD;
     }
-  }
-
-  return UA_STATUSCODE_BADNOTFOUND;
+    return UA_STATUSCODE_BADNOTFOUND;
 }
 
 UA_StatusCode