Add adds the costs and returns the sum. If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64.
(cost CostEstimate)
| 183 | // Add adds the costs and returns the sum. |
| 184 | // If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64. |
| 185 | func (ce CostEstimate) Add(cost CostEstimate) CostEstimate { |
| 186 | return CostEstimate{ |
| 187 | Min: addUint64NoOverflow(ce.Min, cost.Min), |
| 188 | Max: addUint64NoOverflow(ce.Max, cost.Max), |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // Multiply multiplies by the cost and returns the product. |
| 193 | // If multiply would result in an uint64 overflow, the result is math.MaxUint64. |