kaspad/util/math/min.go
Elichai Turkel 1486a6312c
Adjust the difficulty in the first difficultyAdjustmentWindowSize blocks (#1592)
* Move timesorter to its own package and remove unused functions

* Remove padding+genesis from BlockWindow

* Adjust the difficulty even when there's less than difficultyAdjustmentWindowSize blocks

* Remove unnecessary check from checkBlockTransactionsFinalized

* Update tests with new pastMedianTime and Difficulty

* Review nit
2021-03-10 16:11:46 +02:00

26 lines
356 B
Go

package math
// MinInt returns the smaller of x or y.
func MinInt(x, y int) int {
if x < y {
return x
}
return y
}
// MaxInt64 returns the bigger of x or y.
func MaxInt64(x, y int64) int64 {
if x > y {
return x
}
return y
}
// MinUint32 returns the smaller of x or y.
func MinUint32(x, y uint32) uint32 {
if x < y {
return x
}
return y
}