ripple-api/common/in.go

14 lines
228 B
Go
Raw Normal View History

2016-05-28 15:30:18 +00:00
package common
// In picks x if y < x, picks z if y > z, or if none of the previous
// conditions is satisfies, it simply picks y.
func In(x, y, z int) {
switch {
case y < x:
return x
case y > z:
return z
}
return y
}