From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 409156DE18FB for ; Mon, 5 Oct 2015 11:27:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.154 X-Spam-Level: X-Spam-Status: No, score=-0.154 tagged_above=-999 required=5 tests=[AWL=-0.178, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_SBL=0.644, URIBL_SBL_A=0.1] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GbQgLa7Hs-wk for ; Mon, 5 Oct 2015 11:27:56 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by arlo.cworth.org (Postfix) with ESMTPS id 436C36DE157C for ; Mon, 5 Oct 2015 11:27:56 -0700 (PDT) Received: by wicgb1 with SMTP id gb1so132114912wic.1 for ; Mon, 05 Oct 2015 11:27:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=EXSjhfs+/nqY0XeD26ZkKT43HRQ30raJmtD2iNa3+9M=; b=gpmKUyanEMeAjWgjDo4YhPi2k5hx2XQs6/UnwoxQd8X5IiNQGeuSplgJtjgC6jnIeI aZOOnhDTiZBHGlG7ZszEDTSmPRnOwcLjyJC7dOXaGLqdNa7+eXy7D7Hy//ORMAhJGLvT lXXPoYrk4VzfHoumwyRa7qpXgpVcE994sEFVDdMH9U4DOKmDkh2kgfD8j0a1xZpvv+KM ll27vm0o8BkmGt2Z4G19LMWdjmz/i/iGSjfeEIPf5FQuumx+ixxjuQjca8QRIc3agIUk YiowfO+vAJUMnspe8Mz2kPaVhTRhGf1W7jf/dIeNv9zYw0d+opHgB8WS8NgoikCvF7sa tIRw== X-Gm-Message-State: ALoCoQlL1M7RFvVi0Ij6NNsbNhkUeL+UxmL+OvChdWltUe2lVWOWa48+VsRk4Ee50hKQ+u9rN1PL X-Received: by 10.194.92.166 with SMTP id cn6mr31968460wjb.6.1444069674480; Mon, 05 Oct 2015 11:27:54 -0700 (PDT) Received: from localhost (mobile-access-bcee9f-54.dhcp.inet.fi. [188.238.159.54]) by smtp.gmail.com with ESMTPSA id go2sm15908278wib.20.2015.10.05.11.27.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Oct 2015 11:27:54 -0700 (PDT) From: Jani Nikula To: David Bremner , notmuch@notmuchmail.org Subject: Re: [Patch v4 8/9] lib: migrate thread.cc to new query_search API In-Reply-To: <1443367923-11867-9-git-send-email-david@tethera.net> References: <1443367923-11867-1-git-send-email-david@tethera.net> <1443367923-11867-9-git-send-email-david@tethera.net> User-Agent: Notmuch/0.20.2+101~g7b7dadb (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Mon, 05 Oct 2015 21:27:28 +0300 Message-ID: <878u7h892n.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 18:27:59 -0000 On Sun, 27 Sep 2015, David Bremner wrote: > here we rely on thread_id_query being attached to the local talloc > context, so no new cleanup code is needed. LGTM > --- > lib/thread.cc | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/lib/thread.cc b/lib/thread.cc > index c8e58c3..0c937d7 100644 > --- a/lib/thread.cc > +++ b/lib/thread.cc > @@ -447,6 +447,7 @@ _notmuch_thread_create (void *ctx, > > notmuch_messages_t *messages; > notmuch_message_t *message; > + notmuch_status_t status; > > seed_message = _notmuch_message_create (local, notmuch, seed_doc_id, NULL); > if (! seed_message) > @@ -504,9 +505,11 @@ _notmuch_thread_create (void *ctx, > * oldest or newest subject is desired. */ > notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST); > > - /* XXX: this should use the _st version, but it needs an error path > - */ > - for (messages = notmuch_query_search_messages (thread_id_query); > + status = notmuch_query_search_messages_st (thread_id_query, &messages); > + if (status) > + goto DONE; > + > + for (; > notmuch_messages_valid (messages); > notmuch_messages_move_to_next (messages)) > { > -- > 2.5.3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch