From 2a8f636d6e1eccf74b6f5360a3dc99f7c1644f44 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Tue, 14 Dec 2004 18:27:05 +0000 Subject: [PATCH] * and one more dumb mistake bites the dust This commit was SVN r3814. --- src/mca/pcm/base/pcm_base_data_store.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mca/pcm/base/pcm_base_data_store.c b/src/mca/pcm/base/pcm_base_data_store.c index e5d10a409b..b588b9f538 100644 --- a/src/mca/pcm/base/pcm_base_data_store.c +++ b/src/mca/pcm/base/pcm_base_data_store.c @@ -542,17 +542,18 @@ pids_cmp(const void *leftp, const void *rightp) int mca_pcm_base_data_store_pids_uniqify(pid_t **pids, size_t *len) { - int i, j; + size_t i, j; qsort(*pids, *len, sizeof(pid_t), pids_cmp); - for (i = 0 ; i < (int) *len ; ++i) { + for (i = 0 ; i < *len - 1 ;) { if ((*pids)[i] == (*pids)[i + 1]) { - for (j = i + 1 ; j < (int) *len - 1 ; ++i) { + for (j = i + 1 ; j < *len - 1 ; ++j) { (*pids)[j] = (*pids)[j + 1]; } (*len)--; } + if ((*pids)[i] != (*pids)[i + 1]) i++; } return OMPI_SUCCESS;