Skip to content

Commit 4985f72

Browse files
committed
clean: do not pass the whole structure when it is not necessary
The callee parse_choice() only needs to access a NUL-terminated string; instead of insisting to take a pointer to a strbuf, just take a pointer to a character array. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7a4acc3 commit 4985f72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/clean.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,15 @@ static int find_unique(const char *choice, struct menu_stuff *menu_stuff)
477477
*/
478478
static int parse_choice(struct menu_stuff *menu_stuff,
479479
int is_single,
480-
struct strbuf *input,
480+
char *input,
481481
int **chosen)
482482
{
483483
struct string_list choice = STRING_LIST_INIT_NODUP;
484484
struct string_list_item *item;
485485
int nr = 0;
486486
int i;
487487

488-
string_list_split_in_place_f(&choice, input->buf,
488+
string_list_split_in_place_f(&choice, input,
489489
is_single ? "\n" : ", ", -1,
490490
STRING_LIST_SPLIT_TRIM);
491491

@@ -626,7 +626,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
626626

627627
nr = parse_choice(stuff,
628628
opts->flags & MENU_OPTS_SINGLETON,
629-
&choice,
629+
choice.buf,
630630
&chosen);
631631

632632
if (opts->flags & MENU_OPTS_SINGLETON) {

0 commit comments

Comments
 (0)