{"thread":{"id":"16666","subject":"[PATCH] remove unnecessary 'if'","startedAt":"2008-12-10T14:09:16Z","lastAt":"2008-12-14T16:21:01Z","messageCount":2,"participants":["Alexander Potashev"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"97488","messageId":"1228918156-3953-1-git-send-email-aspotashev@gmail.com","threadId":"16666","inReplyTo":null,"subject":"[PATCH] remove unnecessary 'if'","fromName":"Alexander Potashev","fromEmail":"aspotashev@gmail.com","sentAt":"2008-12-10T14:09:16Z","receivedAt":"2008-12-10T14:09:16Z","isPatch":true,"sender":{"key":"aspotashev@gmail.com","avatar":null},"body":"'patch->is_new' is always <= 0 at this point (look at 'assert' at the\nbeginning of the function). In both cases ('is_new < 0' and 'is_new == 0')\nthe result of those two lines is zeroing of 'is_new'.\n\nSigned-off-by: Alexander Potashev <aspotashev@gmail.com>\n---\n builtin-apply.c |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex 4c4d1e1..904a748 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -2440,8 +2440,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s\n \tif (!cached)\n \t\tst_mode = ce_mode_from_stat(*ce, st->st_mode);\n \n-\tif (patch->is_new < 0)\n-\t\tpatch->is_new = 0;\n+\tpatch->is_new = 0;\n \tif (!patch->old_mode)\n \t\tpatch->old_mode = st_mode;\n \tif ((st_mode ^ patch->old_mode) & S_IFMT)\n-- \n1.6.0.4\n"},{"id":"97885","messageId":"20081214162101.GB21358@myhost","threadId":"16666","inReplyTo":"1228918156-3953-1-git-send-email-aspotashev@gmail.com","subject":"Re: [PATCH] remove unnecessary 'if'","fromName":"Alexander Potashev","fromEmail":"aspotashev@gmail.com","sentAt":"2008-12-14T16:21:01Z","receivedAt":"2008-12-14T16:21:01Z","isPatch":true,"sender":{"key":"aspotashev@gmail.com","avatar":null},"body":"Hello all!\n\nWhat happened with this patch? Is it wrong or breaks comprehensibility?\n\nOn 17:09 Wed 10 Dec     , Alexander Potashev wrote:\n> 'patch->is_new' is always <= 0 at this point (look at 'assert' at the\n> beginning of the function). In both cases ('is_new < 0' and 'is_new == 0')\n> the result of those two lines is zeroing of 'is_new'.\n> \n> Signed-off-by: Alexander Potashev <aspotashev@gmail.com>\n> ---\n>  builtin-apply.c |    3 +--\n>  1 files changed, 1 insertions(+), 2 deletions(-)\n> \n> diff --git a/builtin-apply.c b/builtin-apply.c\n> index 4c4d1e1..904a748 100644\n> --- a/builtin-apply.c\n> +++ b/builtin-apply.c\n> @@ -2440,8 +2440,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s\n>  \tif (!cached)\n>  \t\tst_mode = ce_mode_from_stat(*ce, st->st_mode);\n>  \n> -\tif (patch->is_new < 0)\n> -\t\tpatch->is_new = 0;\n> +\tpatch->is_new = 0;\n>  \tif (!patch->old_mode)\n>  \t\tpatch->old_mode = st_mode;\n>  \tif ((st_mode ^ patch->old_mode) & S_IFMT)\n> -- \n> 1.6.0.4\n> \n\n\t\t\t\t\tAlexander\n"}]}