Skip to content

Commit

Permalink
Use SaturatingUSub for hoursSinceArbitrum
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed May 16, 2024
1 parent b0fc626 commit f461346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arbos/programs/programs.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ func (status userStatus) toResult(data []byte, debug bool) ([]byte, string, erro

// Hours since Arbitrum began, rounded down.
func hoursSinceArbitrum(time uint64) uint24 {
return uint24((time - ArbitrumStartTime) / 3600)
return am.SaturatingUUCast[uint24]((am.SaturatingUSub(time, ArbitrumStartTime)) / 3600)
}

// Computes program age in seconds from the hours passed since Arbitrum began.
Expand Down

0 comments on commit f461346

Please sign in to comment.