Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use builtin min
  • Loading branch information
ceyonur committed Sep 19, 2025
commit 1a03e687011f5f20ba43c58075fd8e20394c056b
10 changes: 1 addition & 9 deletions vms/evm/upgrades/common/target_excess.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type TargetExcessParams struct {
// include given the current and desired excess values.
func (p TargetExcessParams) TargetExcess(excess, desired uint64) uint64 {
change := safemath.AbsDiff(excess, desired)
change = getMin(change, p.MaxExcessDiff)
change = min(change, p.MaxExcessDiff)
if excess < desired {
return excess + change
}
Expand Down Expand Up @@ -61,11 +61,3 @@ func MulWithUpperBound(a, b uint64) uint64 {
}
return product
}

// getMin returns the minimum of two uint64 values.
func getMin(a, b uint64) uint64 {
if a < b {
return a
}
return b
}
Loading