Skip to content

Commit 9ddef4d

Browse files
committed
comment updates
1 parent b966a8e commit 9ddef4d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spot-contracts/contracts/_test/LineHelpersTester.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
pragma solidity ^0.8.20;
33

44
import { LineHelpers } from "../_utils/LineHelpers.sol";
5-
import { Line } from "../_interfaces/CommonTypes.sol";
5+
import { Line, Range } from "../_interfaces/CommonTypes.sol";
66

77
contract LineHelpersTester {
8-
// Expose the library functions as public wrappers for testing.
98
function computePiecewiseAvgY(
109
Line memory fn1,
1110
Line memory fn2,

spot-contracts/contracts/_utils/LineHelpers.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)