[PATCH v3 1/6] cli: remove useless talloc_strdup
authorJani Nikula <jani@nikula.org>
Sun, 31 Mar 2013 09:45:58 +0000 (12:45 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:08 +0000 (09:54 -0800)
16/5b330f2f2d26e2054b1e88ba6e09d83c1d88d2 [new file with mode: 0644]

diff --git a/16/5b330f2f2d26e2054b1e88ba6e09d83c1d88d2 b/16/5b330f2f2d26e2054b1e88ba6e09d83c1d88d2
new file mode 100644 (file)
index 0000000..d551693
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id AA805429E30\r
+       for <notmuch@notmuchmail.org>; Sun, 31 Mar 2013 02:46:11 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 06om2978nhZJ for <notmuch@notmuchmail.org>;\r
+       Sun, 31 Mar 2013 02:46:11 -0700 (PDT)\r
+Received: from mail-la0-f47.google.com (mail-la0-f47.google.com\r
+       [209.85.215.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A4CC6431FBF\r
+       for <notmuch@notmuchmail.org>; Sun, 31 Mar 2013 02:46:10 -0700 (PDT)\r
+Received: by mail-la0-f47.google.com with SMTP id fj20so1431187lab.6\r
+       for <notmuch@notmuchmail.org>; Sun, 31 Mar 2013 02:46:09 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+       :references:in-reply-to:references:x-gm-message-state;\r
+       bh=HSbBVlzWV5EVEpcSmRVfQUchsUWdZkFKbr6dI+5OmNA=;\r
+       b=pRVTeLeJ8ohswletNA+Fzlfrv9v7Y5WigXXefA6BjJJp+0jlTLb7tAKm+GhjcR9dpM\r
+       o+LsDeD9zBVApkpQ9J3MfZz8wrG/FhkDuKGEHy4XMXPi6L0WFK4pYmwhDsIXB6ZXNRK6\r
+       VQeRDezzy+VgZrIq7UhgJKT8rSRr8WIejkrzu3a7geef+v/lvtBqyIjgQGYba2QwU9ik\r
+       UQjybo4ZYDuUJ1wuenzyw5SOdpC6YyFnp/5+wmOzuDllBbytcVSftNtrzhbb0p4pCPA7\r
+       HcLR1ILAbX4K7YQswAV/yQQIuQDdp4xTSKreut/uV6ZYlBu1yOpu1hf6OwEbWJ23SyCn\r
+       2Mwg==\r
+X-Received: by 10.112.37.129 with SMTP id y1mr4035537lbj.17.1364723169195;\r
+       Sun, 31 Mar 2013 02:46:09 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id t17sm3751080lam.9.2013.03.31.02.46.07\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 31 Mar 2013 02:46:08 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 1/6] cli: remove useless talloc_strdup\r
+Date: Sun, 31 Mar 2013 12:45:58 +0300\r
+Message-Id:\r
+ <a163d92d4fd1ebde55c57772f58d8b63ac43067c.1364722841.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1364722841.git.jani@nikula.org>\r
+References: <cover.1364722841.git.jani@nikula.org>\r
+In-Reply-To: <cover.1364722841.git.jani@nikula.org>\r
+References: <cover.1364722841.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnCrZ/iygSs9xEl+fPMrsy04H38zFl19oh48LPWKtd9n70OSdDN9vDGMFZ+cfcOaX6S4iHi\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 31 Mar 2013 09:46:12 -0000\r
+\r
+If the condition holds, query_string_from_args() has already returned\r
+a talloc allocated empty string. There's no need to duplicate that.\r
+---\r
+ notmuch-count.c |    4 ----\r
+ 1 file changed, 4 deletions(-)\r
+\r
+diff --git a/notmuch-count.c b/notmuch-count.c\r
+index 390794f..c2f1b7d 100644\r
+--- a/notmuch-count.c\r
++++ b/notmuch-count.c\r
+@@ -71,10 +71,6 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])\r
+       return 1;\r
+     }\r
\r
+-    if (*query_str == '\0') {\r
+-      query_str = talloc_strdup (config, "");\r
+-    }\r
+-\r
+     query = notmuch_query_create (notmuch, query_str);\r
+     if (query == NULL) {\r
+       fprintf (stderr, "Out of memory\n");\r
+-- \r
+1.7.10.4\r
+\r