nic-6443 commented on code in PR #13830:
URL: https://github.com/apache/apisix/pull/13830#discussion_r3792151302


##########
apisix/plugins/graphql-limit-count.lua:
##########
@@ -101,30 +107,38 @@ local function node_depth(node, fragments, visited)
         if not name or visited[name] then
             return 0
         end
+        local cached = depths[name]
+        if cached then
+            return cached
+        end

Review Comment:
   Not an issue here: in Lua only `nil` and `false` are falsy, `0` is truthy, 
so `if cached then` returns a memoized zero from the cache just like any other 
value. A `nil` check would read the same but suggest `0` needs special 
handling, which it doesn't.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to