ifZero

inline fun Int.ifZero(minorBody: () -> Int): Int

Having already compared two things to get an Int that represents less-than, equal, or greater-than, answer that if it's not equal (i.e., not 0). Otherwise use the inlined zero-argument block to do further comparisons.


inline fun <C : Comparable<C>> Int.ifZero(minor1: () -> C, minor2: () -> C): Int

Having already compared two things to get an Int that represents less-than, equal, or greater-than, answer that if it's not equal (i.e., not 0). Otherwise evaluate the two lambdas and use (Comparable.compareTo) to produce an Int to use instead.