avoid unneeded division

This commit is contained in:
Axel Kohlmeyer 2020-09-25 22:10:30 -04:00
parent 6967522a4f
commit 909960514a
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ double ComputePressureUef::compute_scalar()
addstep(update->ntimestep+1); addstep(update->ntimestep+1);
int k =0; int k =0;
scalar = 0; scalar = 0.0;
if (ext_flags[0]) { if (ext_flags[0]) {
scalar += vector[0]; scalar += vector[0];
k++; k++;
@ -92,7 +92,7 @@ double ComputePressureUef::compute_scalar()
k++; k++;
} }
scalar /= k; if (k > 1) scalar /= k;
return scalar; return scalar;
} }