Skip to content

Commit 3d27ae0

Browse files
dyronegitster
authored andcommitted
notes.c: use designated initializers for clarity
The "struct note_data d = { 0, 0, NULL, STRBUF_INIT };" style could be replaced with designated initializer for clarity. Signed-off-by: Teng Long <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ef48fcc commit 3d27ae0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/notes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static int add(int argc, const char **argv, const char *prefix)
405405
struct notes_tree *t;
406406
struct object_id object, new_note;
407407
const struct object_id *note;
408-
struct note_data d = { 0, 0, NULL, STRBUF_INIT };
408+
struct note_data d = { .buf = STRBUF_INIT };
409409
struct option options[] = {
410410
OPT_CALLBACK_F('m', "message", &d, N_("message"),
411411
N_("note contents as a string"), PARSE_OPT_NONEG,
@@ -571,7 +571,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
571571
const struct object_id *note;
572572
char *logmsg;
573573
const char * const *usage;
574-
struct note_data d = { 0, 0, NULL, STRBUF_INIT };
574+
struct note_data d = { .buf = STRBUF_INIT };
575575
struct option options[] = {
576576
OPT_CALLBACK_F('m', "message", &d, N_("message"),
577577
N_("note contents as a string"), PARSE_OPT_NONEG,

0 commit comments

Comments
 (0)