From 90ffde8881f50ba8b91d9d9e881bf59c6488052e Mon Sep 17 00:00:00 2001 From: David Steele Date: Mon, 20 Jul 2020 18:09:32 -0400 Subject: [PATCH] Remove unused constructor strLstNewParam(). This function is not used in the core code so remove it and update the test where it was used. There may eventually be a need for a strLstNewP() function but it doesn't seem worth the code churn until there is an actual requirement. --- src/common/type/stringList.c | 12 +----------- src/common/type/stringList.h | 1 - test/src/module/command/expireTest.c | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/common/type/stringList.c b/src/common/type/stringList.c index 6b67c44c1..b7fa71b50 100644 --- a/src/common/type/stringList.c +++ b/src/common/type/stringList.c @@ -19,17 +19,7 @@ StringList * strLstNew(void) { FUNCTION_TEST_VOID(); - FUNCTION_TEST_RETURN(strLstNewParam(lstComparatorStr)); -} - -StringList * -strLstNewParam(ListComparator *comparator) -{ - FUNCTION_TEST_BEGIN(); - FUNCTION_TEST_PARAM(FUNCTIONP, comparator); - FUNCTION_TEST_END(); - - FUNCTION_TEST_RETURN((StringList *)lstNewP(sizeof(String *), .comparator = comparator)); + FUNCTION_TEST_RETURN((StringList *)lstNewP(sizeof(String *), .comparator = lstComparatorStr)); } /*********************************************************************************************************************************** diff --git a/src/common/type/stringList.h b/src/common/type/stringList.h index 81f90dbdd..a5a19885d 100644 --- a/src/common/type/stringList.h +++ b/src/common/type/stringList.h @@ -18,7 +18,6 @@ typedef struct StringList StringList; Constructors ***********************************************************************************************************************************/ StringList *strLstNew(void); -StringList *strLstNewParam(ListComparator *comparator); // Split a string into a string list based on a delimiter StringList *strLstNewSplit(const String *string, const String *delimiter); diff --git a/test/src/module/command/expireTest.c b/test/src/module/command/expireTest.c index dadac609b..350653edd 100644 --- a/test/src/module/command/expireTest.c +++ b/test/src/module/command/expireTest.c @@ -2052,7 +2052,7 @@ testRun(void) //-------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("archiveId comparator sorting"); - StringList *list = strLstNewParam(archiveIdComparator); + StringList *list = strLstComparatorSet(strLstNew(), archiveIdComparator); strLstAddZ(list, "10-4"); strLstAddZ(list, "11-10");