Skip to content

Commit

Permalink
Merge pull request #56 from minaminao/fix-shadowing-warning
Browse files Browse the repository at this point in the history
Fix shadowing warning
  • Loading branch information
Arachnid authored Aug 21, 2023
2 parents 46983c6 + e36d104 commit 4b2fcc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/strings.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ library strings {
uint _ptr;
}

function memcpy(uint dest, uint src, uint len) private pure {
function memcpy(uint dest, uint src, uint length) private pure {
// Copy word-length chunks while possible
for(; len >= 32; len -= 32) {
for(; length >= 32; length -= 32) {
assembly {
mstore(dest, mload(src))
}
Expand All @@ -54,8 +54,8 @@ library strings {

// Copy remaining bytes
uint mask = type(uint).max;
if (len > 0) {
mask = 256 ** (32 - len) - 1;
if (length > 0) {
mask = 256 ** (32 - length) - 1;
}
assembly {
let srcpart := and(mload(src), not(mask))
Expand Down

0 comments on commit 4b2fcc4

Please sign in to comment.