File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-3.0
2+ pragma solidity ^ 0.8.20 ;
3+
4+ function getEmptyCalldataSlice () pure returns (bytes calldata ) {
5+ bytes calldata empty;
6+
7+ assembly ("memory-safe" ) {
8+ empty.length := 0
9+ }
10+
11+ return empty;
12+ }
Original file line number Diff line number Diff line change 22pragma solidity ^ 0.8.20 ;
33
44import {RESERVED_VALIDATION_DATA_INDEX} from "../helpers/Constants.sol " ;
5+ import {getEmptyCalldataSlice} from "../helpers/EmptyCalldataSlice.sol " ;
56
67/// @title Sparse Calldata Segment Library
78/// @notice Library for working with sparsely-packed calldata segments, identified with an index.
@@ -51,7 +52,7 @@ library SparseCalldataSegmentLib {
5152 function advanceSegmentIfAtIndex (bytes calldata source , uint8 index )
5253 internal
5354 pure
54- returns (bytes memory , bytes calldata )
55+ returns (bytes calldata , bytes calldata )
5556 {
5657 uint8 nextIndex = getIndex (source);
5758
@@ -69,7 +70,7 @@ library SparseCalldataSegmentLib {
6970 return (segment, remainder);
7071 }
7172
72- return ("" , source);
73+ return (getEmptyCalldataSlice () , source);
7374 }
7475
7576 /// @notice Extracts the final segment from the source.
You can’t perform that action at this time.
0 commit comments