From ff21702cec1348b5ae84526210650bdfd356f4dd Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 9 Feb 2026 23:15:14 +0800 Subject: fix review issue --- xmake/modules/private/service/remote_build/client.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/xmake/modules/private/service/remote_build/client.lua b/xmake/modules/private/service/remote_build/client.lua index 93b3bf6c9..09ac126a6 100644 --- a/xmake/modules/private/service/remote_build/client.lua +++ b/xmake/modules/private/service/remote_build/client.lua @@ -469,20 +469,10 @@ function remote_build_client:_init_host() if host_name then -- find host by name or address for _, host in ipairs(remote_build_config.hosts) do - local host_ip, host_port = host.connect:split(":", {plain = true}) - - -- match by name - if host.name == host_name then - address = host.connect - token = host.token - break - -- match by full address - elseif host.connect == host_name then - address = host.connect - token = host.token - break - -- match by IP only (when user doesn't specify port) - elseif host_ip == host_name and not host_name:find(":", 1, true) then + local host_ip, _ = host.connect:split(":", {plain = true}) + if host.name == host_name or + host.connect == host_name or + (host_ip == host_name and not host_name:find(":", 1, true)) then address = host.connect token = host.token break -- cgit v1.3.1