replace for (;;) with while (true)

This commit is contained in:
Axel Kohlmeyer
2023-06-25 05:56:51 -04:00
parent bfa39a37ff
commit 92c118b29f
6 changed files with 18 additions and 18 deletions

View File

@ -338,7 +338,7 @@ void ComputeCentroAtom::select(int k, int n, double *arr)
arr--;
l = 1;
ir = n;
for (;;) {
while (true) {
if (ir <= l + 1) {
if (ir == l + 1 && arr[ir] < arr[l]) { SWAP(arr[l], arr[ir]) }
return;
@ -351,7 +351,7 @@ void ComputeCentroAtom::select(int k, int n, double *arr)
i = l + 1;
j = ir;
a = arr[l + 1];
for (;;) {
while (true) {
do i++;
while (arr[i] < a);
do j--;
@ -378,7 +378,7 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr)
iarr--;
l = 1;
ir = n;
for (;;) {
while (true) {
if (ir <= l + 1) {
if (ir == l + 1 && arr[ir] < arr[l]) {
SWAP(arr[l], arr[ir])
@ -405,7 +405,7 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr)
j = ir;
a = arr[l + 1];
ia = iarr[l + 1];
for (;;) {
while (true) {
do i++;
while (arr[i] < a);
do j--;