From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 3/3] complete: Use string_list_add_sort_uniq()
Date: Fri, 5 Mar 2021 12:03:29 +0100 [thread overview]
Message-ID: <20210305110329.31046-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20210305110329.31046-1-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/complete.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/common/complete.c b/common/complete.c
index ad630f4c95..e504b75606 100644
--- a/common/complete.c
+++ b/common/complete.c
@@ -101,14 +101,7 @@ static int path_command_complete(struct string_list *sl, char *instr)
else
strcat(tmp, " ");
- /* This function is called
- * after command_complete,
- * so we check if a double
- * entry exist */
- if (string_list_contains
- (sl, tmp) == 0) {
- string_list_add_sorted(sl, tmp);
- }
+ string_list_add_sort_uniq(sl, tmp);
}
}
--
2.29.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-03-05 11:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 11:03 [PATCH 1/3] stringlist: Add adding sort uniq Sascha Hauer
2021-03-05 11:03 ` [PATCH 2/3] stringlist: Initialize HEAD str member to NULL Sascha Hauer
2021-03-05 11:03 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210305110329.31046-3-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox