Improving clarity of loops

This commit is contained in:
jtclemm 2020-06-11 14:10:26 -06:00 committed by GitHub
parent 006ada3a52
commit ca424772df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -2078,8 +2078,8 @@ void Atom::add_callback(int flag)
if(i == nextra_grow) {
extra_grow[nextra_grow] = ifix;
} else {
for(j = nextra_grow-1; j >= i; j --)
extra_grow[j+1] = extra_grow[j];
for(j = nextra_grow; j > i; j--)
extra_grow[j] = extra_grow[j-1];
extra_grow[i] = ifix;
}
@ -2096,8 +2096,8 @@ void Atom::add_callback(int flag)
if(i == nextra_restart) {
extra_restart[nextra_restart] = ifix;
} else {
for(j = nextra_restart-1; j >= i; j --)
extra_restart[j+1] = extra_restart[j];
for(j = nextra_restart; j > i; j--)
extra_restart[j] = extra_restart[j-1];
extra_restart[i] = ifix;
}
@ -2114,8 +2114,8 @@ void Atom::add_callback(int flag)
if(i == nextra_border) {
extra_border[nextra_border] = ifix;
} else {
for(j = nextra_border-1; j >= i; j --)
extra_border[j+1] = extra_border[j];
for(j = nextra_border; j > i; j--)
extra_border[j] = extra_border[j-1];
extra_border[i] = ifix;
}