From 46974508854ad98deb2f537be679c0650d768c52 Mon Sep 17 00:00:00 2001 From: Julius Pfrommer Date: Wed, 4 Dec 2024 19:08:05 +0100 Subject: [PATCH] refactor(client): Simplify getEndpointUrl --- src/client/ua_client_connect.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/ua_client_connect.c b/src/client/ua_client_connect.c index 23a5736c663..45da870bf31 100644 --- a/src/client/ua_client_connect.c +++ b/src/client/ua_client_connect.c @@ -41,13 +41,11 @@ findUserTokenPolicy(UA_Client *client, UA_EndpointDescription *endpoint); * We fall back if connecting to an EndpointUrl fails. */ static UA_String getEndpointUrl(UA_Client *client) { - if(client->endpoint.endpointUrl.length > 0) { + if(client->endpoint.endpointUrl.length > 0) return client->endpoint.endpointUrl; - } else if(client->discoveryUrl.length > 0) { + if(client->discoveryUrl.length > 0) return client->discoveryUrl; - } else { - return client->config.endpointUrl; - } + return client->config.endpointUrl; } /* If an EndpointUrl doesn't work (TCP connection fails), fall back to the