Skip to content

Commit

Permalink
Merge branch 'rs/mailinfo-lib'
Browse files Browse the repository at this point in the history
Small code clean-up.

* rs/mailinfo-lib:
  mailinfo: recycle strbuf in check_header()
  • Loading branch information
gitster committed Aug 17, 2016
2 parents 2f66456 + ecf30b2 commit 4a78871
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mailinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ static void handle_content_type(struct mailinfo *mi, struct strbuf *line)
}
}

static void handle_message_id(struct mailinfo *mi, const struct strbuf *line)
{
if (mi->add_message_id)
mi->message_id = strdup(line->buf);
}

static void handle_content_transfer_encoding(struct mailinfo *mi,
const struct strbuf *line)
{
Expand Down Expand Up @@ -495,7 +489,8 @@ static int check_header(struct mailinfo *mi,
len = strlen("Message-Id: ");
strbuf_add(&sb, line->buf + len, line->len - len);
decode_header(mi, &sb);
handle_message_id(mi, &sb);
if (mi->add_message_id)
mi->message_id = strbuf_detach(&sb, NULL);
ret = 1;
goto check_header_out;
}
Expand Down

0 comments on commit 4a78871

Please sign in to comment.