From f6b8ac67ee7e9f286f9fee45848035f496aa5bad Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Tue, 14 Dec 2004 21:06:49 +0000 Subject: [PATCH] * yeah, so it turns out that for an unsigned int, 0 - 1 doesn't equal -1. Since there are no elements in the list, this function doesn't need to do anything anyway. So just short circuit This commit was SVN r3816. --- src/mca/pcm/base/pcm_base_data_store.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mca/pcm/base/pcm_base_data_store.c b/src/mca/pcm/base/pcm_base_data_store.c index b588b9f538..5af290973e 100644 --- a/src/mca/pcm/base/pcm_base_data_store.c +++ b/src/mca/pcm/base/pcm_base_data_store.c @@ -544,6 +544,8 @@ mca_pcm_base_data_store_pids_uniqify(pid_t **pids, size_t *len) { size_t i, j; + if (0 == *len) return OMPI_SUCCESS; + qsort(*pids, *len, sizeof(pid_t), pids_cmp); for (i = 0 ; i < *len - 1 ;) {