diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-06-13 17:36:35 +0800 |
---|---|---|
committer | Remco Bloemen <remco@wicked.ventures> | 2018-06-23 19:53:38 +0800 |
commit | ba1baafca591fca8c1f6d3677021cf452fc5efc7 (patch) | |
tree | 0c936d54a448f90d5de09342d2be35913061c1b5 | |
parent | 20a07494f669e4d161db4906f1a104afb89fbbbf (diff) | |
download | dexon-sol-tools-ba1baafca591fca8c1f6d3677021cf452fc5efc7.tar.gz dexon-sol-tools-ba1baafca591fca8c1f6d3677021cf452fc5efc7.tar.zst dexon-sol-tools-ba1baafca591fca8c1f6d3677021cf452fc5efc7.zip |
Remove `areBytesEqual`
-rw-r--r-- | packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol index a5ef3b5aa..81cd99cff 100644 --- a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol +++ b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol @@ -519,41 +519,6 @@ library LibBytes { ); } - /// @dev Tests equality of two byte arrays. - /// @param lhs First byte array to compare. - /// @param rhs Second byte array to compare. - /// @return True if arrays are the same. False otherwise. - function areBytesEqual( - bytes memory lhs, - bytes memory rhs - ) - internal - pure - returns (bool equal) - { - assembly { - // Get the number of words occupied by <lhs> - let lenFullWords := div(add(mload(lhs), 0x1F), 0x20) - - // Add 1 to the number of words, to account for the length field - lenFullWords := add(lenFullWords, 0x1) - - // Test equality word-by-word. - // Terminates early if there is a mismatch. - for {let i := 0} lt(i, lenFullWords) {i := add(i, 1)} { - let lhsWord := mload(add(lhs, mul(i, 0x20))) - let rhsWord := mload(add(rhs, mul(i, 0x20))) - equal := eq(lhsWord, rhsWord) - if eq(equal, 0) { - // Break - i := lenFullWords - } - } - } - - return equal; - } - /// @dev Performs a deep copy of a byte array onto another byte array of greater than or equal length. /// @param dest Byte array that will be overwritten with source bytes. /// @param source Byte array to copy onto dest bytes. |