Skip to content

Commit

Permalink
Add clarifying comments around array functions (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdomrom committed Nov 16, 2023
1 parent f64d5e3 commit b15187c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/arrays/UnorderedMemoryArray.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pragma solidity ^0.8.0;

library UnorderedMemoryArray {
/**
* @dev Add unique element to existing "array" if and increase max index
* array memory will be updated in place
* @dev Add unique element to existing "array" if and increase max index array memory will be updated in place
* Assumes that the array is not full (i.e. arrayLen < array.length)
* @param array array of number
* @param newElement number to check
* @param arrayLen previously recorded array length with non-zero value
Expand All @@ -33,8 +33,8 @@ library UnorderedMemoryArray {
}

/**
* @dev Add unique element to existing "array" if and increase max index
* array memory will be updated in place
* @dev Add unique element to existing "array" if and increase max index array memory will be updated in place
* Assumes that the array is not full (i.e. arrayLen < array.length)
* @param array array of address
* @param newElement address to check
* @param arrayLen previously recorded array length with non-zero value
Expand Down Expand Up @@ -94,7 +94,7 @@ library UnorderedMemoryArray {
}

/**
* @dev shorten a memory array length in place
* @dev Shorten a memory array length in place. Will produce an invalid result if finalLength > array.length
*/
function trimArray(uint[] memory array, uint finalLength) internal pure {
assembly {
Expand All @@ -103,7 +103,7 @@ library UnorderedMemoryArray {
}

/**
* @dev shorten a memory array length in place
* @dev Shorten a memory array length in place. Will produce an invalid result if finalLength > array.length
*/
function trimArray(address[] memory array, uint finalLength) internal pure {
assembly {
Expand Down

0 comments on commit b15187c

Please sign in to comment.