From commits-return-32357-archive-asf-public=cust-asf.ponee.io@couchdb.apache.org Tue Mar 6 13:28:33 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6128B180676 for ; Tue, 6 Mar 2018 13:28:33 +0100 (CET) Received: (qmail 76952 invoked by uid 500); 6 Mar 2018 12:28:32 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 76943 invoked by uid 99); 6 Mar 2018 12:28:32 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2018 12:28:32 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id E0B8782996; Tue, 6 Mar 2018 12:28:31 +0000 (UTC) Date: Tue, 06 Mar 2018 12:28:31 +0000 To: "commits@couchdb.apache.org" Subject: [couchdb] branch master updated: Fix dialyzer warning on `couch_key_tree:merge/2` MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152033931180.17180.17559630737731038678@gitbox.apache.org> From: jan@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: couchdb X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 3bd033b77ad358a223b01cd8f03fe92caed593dc X-Git-Newrev: 88981040a6e4ae464dbbe1c8b186a9a886a23585 X-Git-Rev: 88981040a6e4ae464dbbe1c8b186a9a886a23585 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. jan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/couchdb.git The following commit(s) were added to refs/heads/master by this push: new 8898104 Fix dialyzer warning on `couch_key_tree:merge/2` 8898104 is described below commit 88981040a6e4ae464dbbe1c8b186a9a886a23585 Author: ILYA Khlopotov AuthorDate: Thu Mar 1 16:59:05 2018 -0800 Fix dialyzer warning on `couch_key_tree:merge/2` The spec of `couch_key_tree:merge/2` doesn't include the `path()` type. However we pass `path()` in few places. One of such places is `couch_db:prep_and_validate_replicated_updates/5`. ``` {NewTree, _} = couch_key_tree:merge(AccTree, couch_doc:to_path(NewDoc), RevsLimit), NewTree ``` The spec for `couch_doc:to_path/1` is defined as: ``` -spec to_path(#doc{}) -> path(). ``` This PR adds `path()` type to `couch_key_tree:merge/2` spec. --- src/couch/src/couch_key_tree.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/couch/src/couch_key_tree.erl b/src/couch/src/couch_key_tree.erl index e2e187e..cd661e2 100644 --- a/src/couch/src/couch_key_tree.erl +++ b/src/couch/src/couch_key_tree.erl @@ -73,7 +73,7 @@ stem/2 %% @doc Merge a path into the given tree and then stem the result. %% Although Tree is of type tree(), it must not contain any branches. --spec merge(revtree(), tree(), pos_integer()) -> +-spec merge(revtree(), tree() | path(), pos_integer()) -> {revtree(), new_leaf | new_branch | internal_node}. merge(RevTree, Tree, StemDepth) -> {Merged, Result} = merge(RevTree, Tree), @@ -84,7 +84,7 @@ merge(RevTree, Tree, StemDepth) -> %% @doc Merge a path into a tree. --spec merge(revtree(), tree()) -> +-spec merge(revtree(), tree() | path()) -> {revtree(), new_leaf | new_branch | internal_node}. merge(RevTree, Tree) -> {Merged, Result} = merge_tree(RevTree, Tree, []), @@ -94,7 +94,7 @@ merge(RevTree, Tree) -> %% @doc Attempt to merge Tree into each branch of the RevTree. %% If it can't find a branch that the new tree merges into, add it as a %% new branch in the RevTree. --spec merge_tree(revtree(), tree(), revtree()) -> +-spec merge_tree(revtree(), tree() | path(), revtree()) -> {revtree(), new_leaf | new_branch | internal_node}. merge_tree([], Tree, []) -> {[Tree], new_leaf}; -- To stop receiving notification emails like this one, please contact jan@apache.org.