You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/utils/Arrays.sol
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -466,21 +466,21 @@ library Arrays {
466
466
}
467
467
468
468
/**
469
-
* @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array.
469
+
* @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array,
470
+
* and shrinks the array length accordingly, effectively overwriting the array with array[start:].
470
471
*
471
472
* NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.
472
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
473
473
*/
474
474
function splice(address[] memoryarray, uint256start) internalpurereturns (address[] memory) {
475
475
returnsplice(array, start, array.length);
476
476
}
477
477
478
478
/**
479
-
* @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array. The
479
+
* @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array,
480
+
* and shrinks the array length accordingly, effectively overwriting the array with array[start:end]. The
480
481
* `end` argument is truncated to the length of the `array`.
481
482
*
482
483
* NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.
483
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
484
484
*/
485
485
function splice(address[] memoryarray, uint256start, uint256end) internalpurereturns (address[] memory) {
486
486
// sanitize
@@ -499,7 +499,7 @@ library Arrays {
499
499
/**
500
500
* @dev Replaces elements in `array` starting at `pos` with all elements from `replacement`.
501
501
*
502
-
* Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, array.length]`).
502
+
* Parameters are clamped to valid ranges (e.g. `pos` is clamped to `[0, array.length]`).
503
503
* If `pos >= array.length`, no replacement occurs and the array is returned unchanged.
504
504
*
505
505
* NOTE: This function modifies the provided array in place.
* @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array.
551
+
* @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array,
552
+
* and shrinks the array length accordingly, effectively overwriting the array with array[start:].
552
553
*
553
554
* NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.
554
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
555
555
*/
556
556
function splice(bytes32[] memoryarray, uint256start) internalpurereturns (bytes32[] memory) {
557
557
returnsplice(array, start, array.length);
558
558
}
559
559
560
560
/**
561
-
* @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array. The
561
+
* @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array,
562
+
* and shrinks the array length accordingly, effectively overwriting the array with array[start:end]. The
562
563
* `end` argument is truncated to the length of the `array`.
563
564
*
564
565
* NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.
565
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
566
566
*/
567
567
function splice(bytes32[] memoryarray, uint256start, uint256end) internalpurereturns (bytes32[] memory) {
568
568
// sanitize
@@ -581,7 +581,7 @@ library Arrays {
581
581
/**
582
582
* @dev Replaces elements in `array` starting at `pos` with all elements from `replacement`.
583
583
*
584
-
* Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, array.length]`).
584
+
* Parameters are clamped to valid ranges (e.g. `pos` is clamped to `[0, array.length]`).
585
585
* If `pos >= array.length`, no replacement occurs and the array is returned unchanged.
586
586
*
587
587
* NOTE: This function modifies the provided array in place.
* @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array.
633
+
* @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array,
634
+
* and shrinks the array length accordingly, effectively overwriting the array with array[start:].
634
635
*
635
636
* NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.
636
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
637
637
*/
638
638
function splice(uint256[] memoryarray, uint256start) internalpurereturns (uint256[] memory) {
639
639
returnsplice(array, start, array.length);
640
640
}
641
641
642
642
/**
643
-
* @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array. The
643
+
* @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array,
644
+
* and shrinks the array length accordingly, effectively overwriting the array with array[start:end]. The
644
645
* `end` argument is truncated to the length of the `array`.
645
646
*
646
647
* NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.
647
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
648
648
*/
649
649
function splice(uint256[] memoryarray, uint256start, uint256end) internalpurereturns (uint256[] memory) {
650
650
// sanitize
@@ -663,7 +663,7 @@ library Arrays {
663
663
/**
664
664
* @dev Replaces elements in `array` starting at `pos` with all elements from `replacement`.
665
665
*
666
-
* Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, array.length]`).
666
+
* Parameters are clamped to valid ranges (e.g. `pos` is clamped to `[0, array.length]`).
667
667
* If `pos >= array.length`, no replacement occurs and the array is returned unchanged.
668
668
*
669
669
* NOTE: This function modifies the provided array in place.
Copy file name to clipboardExpand all lines: contracts/utils/Bytes.sol
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -98,28 +98,28 @@ library Bytes {
98
98
}
99
99
100
100
/**
101
-
* @dev Moves the content of `buffer`, from `start` (included) to the end of `buffer` to the start of that buffer.
101
+
* @dev Moves the content of `buffer`, from `start` (included) to the end of `buffer` to the start of that buffer,
102
+
* and shrinks the buffer length accordingly, effectively overriding the content of buffer with buffer[start:].
102
103
*
103
104
* NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead
104
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
105
105
*/
106
106
function splice(bytesmemorybuffer, uint256start) internalpurereturns (bytesmemory) {
107
107
returnsplice(buffer, start, buffer.length);
108
108
}
109
109
110
110
/**
111
-
* @dev Moves the content of `buffer`, from `start` (included) to end (excluded) to the start of that buffer. The
112
-
* `end` argument is truncated to the length of the `buffer`.
111
+
* @dev Moves the content of `buffer`, from `start` (included) to `end` (excluded) to the start of that buffer,
112
+
* and shrinks the buffer length accordingly, effectively overriding the content of buffer with buffer[start:end].
113
+
* The `end` argument is truncated to the length of the `buffer`.
113
114
*
114
115
* NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead
115
-
* NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice[Javascript's `Array.splice`]
116
116
*/
117
117
function splice(bytesmemorybuffer, uint256start, uint256end) internalpurereturns (bytesmemory) {
0 commit comments