Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / CSD_Strategy_Tests / TP_Common / StatisticsHelper.cpp
blobe4b52dcaaae1e56a4db4aa6978b329bf3094b837
1 #include "StatisticsHelper.h"
3 // swap function for integers
4 void swap (CORBA::Long& x, CORBA::Long& y)
6 CORBA::Long temp;
7 temp = x;
8 x = y;
9 y = temp;
13 void sort (LongVector & vector)
15 unsigned size = vector.size ();
17 if (size > 0)
19 unsigned indexOfMin;
20 unsigned pass;
21 unsigned j;
23 for (pass = 0; pass < size - 1; pass++ )
25 indexOfMin = pass;
27 for (j = pass + 1; j < size; j++ )
28 if (vector[j] < vector[indexOfMin] )
29 indexOfMin = j;
31 swap (vector[pass], vector[indexOfMin]);