Commit a4cec2c
authored
fix(flatten): sort by loc path and loc start (#302)
ref foundry-rs/foundry#11417
for
```Solidity
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19;
...
function convert(UD60x18 x) pure returns (uint256 result) {
...
}
function convert(uint256 x) pure returns (UD60x18 result) {
...
}
```
we have items as
```
[
(8378, ItemLocation { path: "lib/prb-math/src/ud60x18/Conversions.sol", start: 462, end: 469 }),
(8409, ItemLocation { path: "lib/prb-math/src/ud60x18/Conversions.sol", start: 833, end: 840 })
]
```
but we sort only by path, hence order could be reversed.
Sort also by loc.start to make sure order is preserved1 parent a30af45 commit a4cec2c
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
| 320 | + | |
| 321 | + | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
0 commit comments