From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EBFA3429E38 for ; Fri, 30 Dec 2011 20:45:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 omNTgsoUOovN for ; Fri, 30 Dec 2011 20:45:14 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id E20D8429E2F for ; Fri, 30 Dec 2011 20:45:13 -0800 (PST) X-AuditID: 1209190c-b7fad6d000000920-06-4efe93587477 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id CC.57.02336.8539EFE4; Fri, 30 Dec 2011 23:45:12 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id pBV4jBDn030189; Fri, 30 Dec 2011 23:45:11 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pBV4jAOc012937 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Fri, 30 Dec 2011 23:45:11 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RgqpK-0006pc-KF; Fri, 30 Dec 2011 23:45:50 -0500 Date: Fri, 30 Dec 2011 23:45:50 -0500 From: Austin Clements To: Kazuo Teramoto Subject: Re: [PATCH 1/2] lib: Remove unnecessary checks when calling g_mime_init Message-ID: <20111231044550.GL30150@mit.edu> References: <877h1e6r9d.fsf@zancas.localnet> <1325282290-29565-1-git-send-email-kaz.rag@gmail.com> <1325282290-29565-2-git-send-email-kaz.rag@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1325282290-29565-2-git-send-email-kaz.rag@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42IR4hRV1o2Y/M/PYNpMOYsbrd2MFt/mPmCy uH5zJrMDs8fOWXfZPZ6tusXsseXQe+YA5igum5TUnMyy1CJ9uwSujCMXjrMWXOGuOHHxKGMD 40eOLkZODgkBE4n+8zfYIWwxiQv31rOB2EIC+xgl+l+mdzFyAdkbGCWurH3NBuGcZJK4+6wF qmoJo8St+fEgNouAqsSr32tZQWw2AQ2JbfuXM4LYIgJqEq2bz4HVMwvYSSz/9ZgJxBYWCJLo vDwdrJ5XQEficsMSVogFcxglNvRcYoNICEqcnPmEBaJZS+LGv5dAzRxAtrTE8n9gH3AKOEk8 3vkUbJeogIrElJPb2CYwCs1C0j0LSfcshO4FjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdA31 cjNL9FJTSjcxgkNdkmcH45uDSocYBTgYlXh4d77+6yfEmlhWXJl7iFGSg0lJlHf+xH9+QnxJ +SmVGYnFGfFFpTmpxYcYJTiYlUR4eQuAcrwpiZVVqUX5MClpDhYlcV4VrXd+QgLpiSWp2amp BalFMFkZDg4lCd6Jk4AaBYtS01Mr0jJzShDSTBycIMN5gIYngCzmLS5IzC3OTIfIn2JUlBLn zQFpFgBJZJTmwfXCUtErRnGgV4R5+0GqeIBpDK77FdBgJqDB5879AhlckoiQkmpglP/rqPF/ WuRcdsaKGS3nz76YZb1wz4qX565qa0dyJn0Knxxczlj96+uJwoZ3NpvfO85fVhp83iDw/b+3 os/sjonc51/mEfD0e/HvJx4zA7P9797czTb78MzIrQndfhUTZ3EKFnw3XuHtvexq28dGrjDR uIXcf588Lq2OsEheHnR1/x+Rrn+SHEosxRmJhlrMRcWJAFu9L7kgAwAA Cc: notmuch@notmuchmail.org 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: Sat, 31 Dec 2011 04:45:15 -0000 Shouldn't we remove the g_mime_init's from this code entirely if we're going to do it in notmuch_database_open? Quoth Kazuo Teramoto on Dec 30 at 7:58 pm: > 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; >