[PATCH 3/3] complete: Use string_list_add_sort_uniq()

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 5 11:03:29 GMT 2021


Signed-off-by: Sascha Hauer <s.hauer at 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




More information about the barebox mailing list