OregonStateUniversity / fs-ops-normal

Forest Service initial attack hose & equipment estimator for wildland fires.
3 stars 1 forks source link

Estimate: Normalize shape/direction of conditionals #309

Closed ybakos closed 1 year ago

ybakos commented 1 year ago

About 12 methods in Estimate have a short conditional, eg:

if (acres! >= 20) {

This spins in the opposite direction of other methods, eg:

if (structures! < 10) {

Switch the direction of the conditional so they check for < 20 first. eg:

    if (acres! >= 20) {
      return (acres! ~/ 20).toInt();
    } else {
      return 0;
    }

Becomes

    if (acres! < 20) {
      return 0;
    } else {
      return (acres! ~/ 20).toInt();
    }