Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3A121429E27 for ; Fri, 30 Dec 2011 13:58:52 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gm2Eqqc6Svmm for ; Fri, 30 Dec 2011 13:58:51 -0800 (PST) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DFEE6429E26 for ; Fri, 30 Dec 2011 13:58:48 -0800 (PST) Received: by mail-qy0-f181.google.com with SMTP id a6so10990719qch.26 for ; Fri, 30 Dec 2011 13:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=q8ACQ1SUbnoNz7lin/78tReMG7lcLgM8Phr5YTlxAu0=; b=rOmTW576y5vjRRJmJtFdA0PxjpwTkpVhkjvOq74xxDeaj0z9JVhFQlohVz1O/AochV ckPyI8Ld7gZICpfCDuom1bUEl5xjLmPFh92aEqMwLhEbD5fVl6HZnyLvjpnxv0mrMrVG Gm4DLd+M8uARvIc6RS0AaxOIrjfoWVYupjkGw= Received: by 10.229.135.208 with SMTP id o16mr14702857qct.15.1325282328697; Fri, 30 Dec 2011 13:58:48 -0800 (PST) Received: from localhost.localdomain (201-1-35-143.dsl.telesp.net.br. [201.1.35.143]) by mx.google.com with ESMTPS id z1sm74916346qao.1.2011.12.30.13.58.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Dec 2011 13:58:48 -0800 (PST) From: Kazuo Teramoto To: notmuch@notmuchmail.org, David Bremner Subject: [PATCH 1/2] lib: Remove unnecessary checks when calling g_mime_init Date: Fri, 30 Dec 2011 19:58:09 -0200 Message-Id: <1325282290-29565-2-git-send-email-kaz.rag@gmail.com> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <1325282290-29565-1-git-send-email-kaz.rag@gmail.com> References: <877h1e6r9d.fsf@zancas.localnet> <1325282290-29565-1-git-send-email-kaz.rag@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Fri, 30 Dec 2011 21:58:52 -0000 g_mime_init already check for multiple initializations. --- lib/index.cc | 4 ---- lib/message-file.c | 4 ---- 2 files changed, 0 insertions(+), 8 deletions(-) diff --git a/lib/index.cc b/lib/index.cc index d8f8b2b..6764929 100644 --- a/lib/index.cc +++ b/lib/index.cc @@ -419,12 +419,8 @@ _notmuch_message_index_file (notmuch_message_t *message, FILE *file = NULL; const char *from, *subject; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; - static int initialized = 0; - if (! initialized) { g_mime_init (0); - initialized = 1; - } file = fopen (filename, "r"); if (! file) { diff --git a/lib/message-file.c b/lib/message-file.c index 915aba8..78c7820 100644 --- a/lib/message-file.c +++ b/lib/message-file.c @@ -223,14 +223,10 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, char *header, *decoded_value, *header_sofar, *combined_header; const char *s, *colon; int match, newhdr, hdrsofar, is_received; - static int initialized = 0; is_received = (strcmp(header_desired,"received") == 0); - if (! initialized) { g_mime_init (0); - initialized = 1; - } message->parsing_started = 1; -- 1.7.8.1