Suppress variable exported from 'case' compiler warnings
authorJay Doane <jay.s.doane@gmail.com>
Thu, 13 Dec 2018 03:03:16 +0000 (19:03 -0800)
committerJay Doane <jay.s.doane@gmail.com>
Thu, 27 Dec 2018 21:07:57 +0000 (13:07 -0800)
src/couch/src/couch_btree.erl
src/couch/src/couch_compaction_daemon.erl

index ea224b1..daf846b 100644 (file)
@@ -378,13 +378,12 @@ get_chunk_size() ->
     end.
 
 modify_node(Bt, RootPointerInfo, Actions, QueryOutput) ->
-    case RootPointerInfo of
+    {NodeType, NodeList} = case RootPointerInfo of
     nil ->
-        NodeType = kv_node,
-        NodeList = [];
+        {kv_node, []};
     _Tuple ->
         Pointer = element(1, RootPointerInfo),
-        {NodeType, NodeList} = get_node(Bt, Pointer)
+        get_node(Bt, Pointer)
     end,
     NodeTuple = list_to_tuple(NodeList),
 
index fea505e..115a9a8 100644 (file)
@@ -167,15 +167,15 @@ maybe_compact_db(Parent, DbName, Config) ->
             gen_server:call(Parent, {start, DbName}),
             {ok, _} = couch_db:start_compact(Db),
             TimeLeft = compact_time_left(Config),
-            case Config#config.parallel_view_compact of
+            {ViewsCompactPid, ViewsMonRef} = case Config#config.parallel_view_compact of
             true ->
-                ViewsCompactPid = spawn_link(fun() ->
+                Pid = spawn_link(fun() ->
                     maybe_compact_views(DbName, DDocNames, Config)
                 end),
-                ViewsMonRef = erlang:monitor(process, ViewsCompactPid);
+                Ref = erlang:monitor(process, Pid),
+                {Pid, Ref};
             false ->
-                ViewsCompactPid = nil,
-                ViewsMonRef = nil
+                {nil, nil}
             end,
             case couch_db:wait_for_compaction(Db, TimeLeft) of
                 ok ->