From c3aec74e5815cf2a260b68f7b0fddef749a19b4d Mon Sep 17 00:00:00 2001 From: SineStriker <55847490+SineStriker@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:46:17 +0800 Subject: Optimize Code --- xmake/modules/net/proxy.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xmake/modules/net/proxy.lua') diff --git a/xmake/modules/net/proxy.lua b/xmake/modules/net/proxy.lua index bc00ce655..f473e3068 100644 --- a/xmake/modules/net/proxy.lua +++ b/xmake/modules/net/proxy.lua @@ -109,7 +109,7 @@ function _system_proxy() return proxy end - if os.host() == "windows" then + if is_host("windows") then -- Check whether system proxy is enabled local proxy_enable = winos.registry_query('HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings;ProxyEnable') -- Verify that the proxy is enabled (0x1 means enabled) @@ -136,7 +136,7 @@ end -- translate global proxy function _global_proxy() local proxy = global.get("proxy") - if proxy and string.lower(proxy) == "system" then + if proxy and proxy:lower() == "system" then return _system_proxy() end return proxy -- cgit v1.3.1