Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5862418674 for ; Thu, 3 Sep 2015 22:33:43 +0000 (UTC) Received: (qmail 81568 invoked by uid 500); 3 Sep 2015 22:33:43 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 81390 invoked by uid 500); 3 Sep 2015 22:33:43 -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 81257 invoked by uid 99); 3 Sep 2015 22:33:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2015 22:33:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 06F98E7EB6; Thu, 3 Sep 2015 22:33:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tonysun83@apache.org To: commits@couchdb.apache.org Date: Thu, 03 Sep 2015 22:33:44 -0000 Message-Id: <0b944b7979ea4b55bdd6d8ef540ed087@git.apache.org> In-Reply-To: <8819993897124febbe7b810cc18896ec@git.apache.org> References: <8819993897124febbe7b810cc18896ec@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] couchdb-mango git commit: Use short circuit operators Use short circuit operators COUCHDB-2787 Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/8b6d0dbd Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/8b6d0dbd Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/8b6d0dbd Branch: refs/heads/2787-merge-repos Commit: 8b6d0dbd3540cf34d9703526ba0b0b6d3226ff8d Parents: 928d76a Author: Tony Sun Authored: Thu Sep 3 15:26:59 2015 -0700 Committer: Tony Sun Committed: Thu Sep 3 15:26:59 2015 -0700 ---------------------------------------------------------------------- src/mango_idx_view.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/8b6d0dbd/src/mango_idx_view.erl ---------------------------------------------------------------------- diff --git a/src/mango_idx_view.erl b/src/mango_idx_view.erl index a313f56..cc5bcb3 100644 --- a/src/mango_idx_view.erl +++ b/src/mango_idx_view.erl @@ -112,7 +112,7 @@ is_usable(Idx, Selector) -> % a member of the indexable fields of the selector. Columns = columns(Idx), Fields = indexable_fields(Selector), - lists:member(hd(Columns), Fields) and not is_text_search(Selector). + lists:member(hd(Columns), Fields) andalso not is_text_search(Selector). is_text_search({[]}) -> @@ -121,7 +121,7 @@ is_text_search({[{<<"$default">>, _}]}) -> true; is_text_search({[{_Field, Cond}]}) when is_list(Cond) -> lists:foldl(fun(C, Exists) -> - Exists or is_text_search(C) + Exists orelse is_text_search(C) end, false, Cond); is_text_search({[{_Field, Cond}]}) when is_tuple(Cond) -> is_text_search(Cond);