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

ronny pushed a commit to branch fix-bound-var
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 26a1e6b7fcb7b8e7f747daa85a55ef8c23d332c7
Author: Ronny Berndt <[email protected]>
AuthorDate: Mon Dec 5 14:08:03 2022 +0100

    Fix unbound variable warning
    
    While the variable is not really unbound in the case-statement, use a
    more up-to-date pattern for binding the value.
---
 src/couch/src/couch_server.erl | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index 271f7823f..8cce345e0 100644
--- a/src/couch/src/couch_server.erl
+++ b/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;
+                            Filename -> Filename
+                        end,
                     Ext = filename:extension(RelativeFilename),
                     case Fun(?l2b(filename:rootname(RelativeFilename, Ext)), 
AccIn) of
                         {ok, NewAcc} -> NewAcc;

Reply via email to