Skip to content

Commit

Permalink
Merge branch 'master' into add-validation-in-governor-when-receive-er…
Browse files Browse the repository at this point in the history
…c721-erc1155
  • Loading branch information
clauBv23 authored Jun 6, 2023
2 parents 6a8d20f + 253bfa6 commit e13ef57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-crabs-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openzeppelin-solidity': patch
---

Optimize `Strings.equal`
2 changes: 1 addition & 1 deletion contracts/utils/Strings.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ library Strings {
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}

0 comments on commit e13ef57

Please sign in to comment.