From 20b38983904d235c8c155c60e91d5311e443c1ef Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 31 Aug 2004 09:34:12 +0000 Subject: [PATCH] Remove a bunch of code and replace it with a single line: ompi_argv_split(). Mmmm... the Goodness of a rich internal API... tasty! This commit was SVN r2404. --- src/mca/base/mca_base_components_open.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/mca/base/mca_base_components_open.c b/src/mca/base/mca_base_components_open.c index 64c7f83a6f..f3cdec8850 100644 --- a/src/mca/base/mca_base_components_open.c +++ b/src/mca/base/mca_base_components_open.c @@ -101,9 +101,6 @@ int mca_base_components_open(const char *type_name, int output_id, static int parse_requested(int mca_param, char ***requested_component_names) { char *requested; - char *comma; - char *start; - int argc; *requested_component_names = NULL; @@ -115,23 +112,7 @@ static int parse_requested(int mca_param, char ***requested_component_names) if (NULL == requested) { return OMPI_SUCCESS; } - - /* Loop over all names (yes, this could be more clever, but it's - nice and obvious this way!) */ - - start = requested; - comma = strchr(start, ','); - while (NULL != comma) { - *comma = '\0'; - ompi_argv_append(&argc, requested_component_names, start); - - start = comma + 1; - comma = strchr(start, ','); - } - - /* The last name */ - - ompi_argv_append(&argc, requested_component_names, start); + *requested_component_names = ompi_argv_split(requested, ','); /* All done */