You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/12/05 15:04:24 UTC

[GitHub] [couchdb] nickva commented on a diff in pull request #4289: Fix unbound variable warning

nickva commented on code in PR #4289:
URL: https://github.com/apache/couchdb/pull/4289#discussion_r1039713337


##########
src/couch/src/couch_server.erl:
##########
@@ -416,10 +416,11 @@ all_databases(Fun, Acc0) ->
                 true,
                 fun(Filename, AccIn) ->
                     NormFilename = couch_util:normpath(Filename),
-                    case NormFilename -- NormRoot of
-                        [$/ | RelativeFilename] -> ok;
-                        RelativeFilename -> ok
-                    end,
+                    RelativeFilename =
+                        case NormFilename -- NormRoot of
+                            [$/ | Filename] -> Filename;

Review Comment:
   We don't want to use `Filename` as that will have to match with already bound `Filename` from `fun(Filename, AccIn)`. Inside case clauses, we can just use a shorted variable if there is minimal chance collision, so something like `FN` perhaps?



-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org