You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ni...@apache.org on 2026/04/17 06:14:24 UTC

(apisix) branch feat/consul-registry-refactor updated: refactor: simplify get_consul_services, remove unnecessary local

This is an automated email from the ASF dual-hosted git repository.

nic443 pushed a commit to branch feat/consul-registry-refactor
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/feat/consul-registry-refactor by this push:
     new 706ee02e8 refactor: simplify get_consul_services, remove unnecessary local
706ee02e8 is described below

commit 706ee02e890ae29bc8bf8cbe599f354e572ab262
Author: Nic <qi...@api7.ai>
AuthorDate: Fri Apr 17 14:14:12 2026 +0800

    refactor: simplify get_consul_services, remove unnecessary local
---
 apisix/discovery/consul/client.lua | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/apisix/discovery/consul/client.lua b/apisix/discovery/consul/client.lua
index 464e9d88c..a6690e4f4 100644
--- a/apisix/discovery/consul/client.lua
+++ b/apisix/discovery/consul/client.lua
@@ -453,9 +453,8 @@ local function iter_and_add_service(services, values)
             goto CONTINUE
         end
 
-        local svc_name = up.service_name
-        if not services[svc_name] then
-            services[svc_name] = true
+        if not services[up.service_name] then
+            services[up.service_name] = true
         end
         ::CONTINUE::
     end