From d17e031259e11e3e37cbb837245171cbdd4d219b Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Fri, 25 May 2018 17:20:00 -0700 Subject: Fixed up wording in memcpy --- packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/contracts/src') diff --git a/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol b/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol index b07a5da54..215a661e2 100644 --- a/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol +++ b/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol @@ -82,8 +82,8 @@ contract LibMem { // Example: // Suppose a word of 8 bits has all 1's: [11111111] // Let X = 7 (we want to free the first 7 bits, and retain the last bit) - // Apply a left shift of 1: [11111110] - // Apply a right shift of 1: [01111111] + // Apply a left shift of 7: [10000000] + // Apply a right shift of 7: [00000001] let destShiftFactor := exp(2, mul(8, remainder)) let destWord := mload(add(dest, offset)) let destBytes := div(mul(destWord, destShiftFactor), destShiftFactor) @@ -92,7 +92,7 @@ contract LibMem { // The source bytes run from [0..X-1] and the dest bytes from [X..31]. // Example: // Following the example from above, we have [11111110] - // from the source word and [01111111] from the dest word. + // from the source word and [00000001] from the dest word. // Combine these words using to get [11111111]. let combinedDestWord := or(sourceBytes, destBytes) -- cgit v1.2.3