Mercurial > blahgd > fmt4
changeset 1127:5125186f0d0a
post: simplify tag adding code
There's no need for the temporary variable.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Tue, 12 Jun 2018 13:05:12 -0400 |
parents | 5556e68e971c |
children | 87154fb110ca |
files | post.c |
diffstat | 1 files changed, 1 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/post.c Sat Jun 09 20:08:53 2018 -0400 +++ b/post.c Tue Jun 12 13:05:12 2018 -0400 @@ -101,19 +101,14 @@ sexpr_for_each_noref(tagval, tmp, list) { struct post_tag *tag; - struct str *tagname; /* sanity check */ ASSERT3U(tagval->type, ==, VT_STR); - /* get the tag name */ - tagname = val_getref_str(tagval); - tag = malloc(sizeof(struct post_tag)); ASSERT(tag); - tag->tag = tagname; - ASSERT(tag->tag); + tag->tag = val_getref_str(tagval); if (safe_avl_add(taglist, tag)) { /* found a duplicate */