File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 22pragma solidity ^ 0.8.20 ;
33
44import { LineHelpers } from "../_utils/LineHelpers.sol " ;
5- import { Line } from "../_interfaces/CommonTypes.sol " ;
5+ import { Line, Range } from "../_interfaces/CommonTypes.sol " ;
66
77contract LineHelpersTester {
8- // Expose the library functions as public wrappers for testing.
98 function computePiecewiseAvgY (
109 Line memory fn1 ,
1110 Line memory fn2 ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ library LineHelpers {
2323 * If the x-range spans `xBreakPt`, it computes a weighted average of the two sub-ranges, weighted by their lengths.
2424 * @param fn1 The linear function used for x-values below `xBreakPt`.
2525 * @param fn2 The linear function used for x-values above or equal to `xBreakPt`.
26- * @param xRange The x-range over which to compute the average. Expected to have `lower` and `upper` bounds.
26+ * @param xRange The x-range over which to compute the average.
2727 * @param xBreakPt The x-coordinate where the piecewise function transitions from `fn1` to `fn2`.
2828 * @return yVal The computed weighted average y-value over the x-range.
2929 */
@@ -36,6 +36,7 @@ library LineHelpers {
3636 if (xRange.lower > xRange.upper) {
3737 revert InvalidRange ();
3838 }
39+
3940 if (xRange.upper <= xBreakPt) {
4041 // Entire range is below the breakpoint.
4142 yVal = avgY (fn1, xRange.lower, xRange.upper);
You can’t perform that action at this time.
0 commit comments