From: Alexander Potashev <aspotashev@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Alexander Potashev <aspotashev@gmail.com>
Subject: [PATCH] remove unnecessary 'if'
Date: Wed, 10 Dec 2008 17:09:16 +0300 [thread overview]
Message-ID: <1228918156-3953-1-git-send-email-aspotashev@gmail.com> (raw)
'patch->is_new' is always <= 0 at this point (look at 'assert' at the
beginning of the function). In both cases ('is_new < 0' and 'is_new == 0')
the result of those two lines is zeroing of 'is_new'.
Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
---
builtin-apply.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index 4c4d1e1..904a748 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2440,8 +2440,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s
if (!cached)
st_mode = ce_mode_from_stat(*ce, st->st_mode);
- if (patch->is_new < 0)
- patch->is_new = 0;
+ patch->is_new = 0;
if (!patch->old_mode)
patch->old_mode = st_mode;
if ((st_mode ^ patch->old_mode) & S_IFMT)
--
1.6.0.4
next reply other threads:[~2008-12-10 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-10 14:09 Alexander Potashev [this message]
2008-12-14 16:21 ` [PATCH] remove unnecessary 'if' Alexander Potashev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1228918156-3953-1-git-send-email-aspotashev@gmail.com \
--to=aspotashev@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).