Adjust return expressions in compilation tests.

This commit is contained in:
Daniel Kirchner 2018-08-07 20:47:52 +02:00
parent bb518b59aa
commit 576ba91970
2 changed files with 8 additions and 9 deletions

View File

@ -46,7 +46,6 @@ library RLP {
subItem = next(self); subItem = next(self);
if(strict && !_validate(subItem)) if(strict && !_validate(subItem))
revert(); revert();
return;
} }
function hasNext(Iterator memory self) internal view returns (bool) { function hasNext(Iterator memory self) internal view returns (bool) {
@ -171,10 +170,11 @@ library RLP {
/// @return The bytes. /// @return The bytes.
function toBytes(RLPItem memory self) internal returns (bytes memory bts) { function toBytes(RLPItem memory self) internal returns (bytes memory bts) {
uint len = self._unsafe_length; uint len = self._unsafe_length;
if (len == 0) if (len != 0)
return; {
bts = new bytes(len); bts = new bytes(len);
_copyToBytes(self._unsafe_memPtr, bts, len); _copyToBytes(self._unsafe_memPtr, bts, len);
}
} }
/// @dev Decode an RLPItem into bytes. This will not work if the /// @dev Decode an RLPItem into bytes. This will not work if the
@ -359,9 +359,8 @@ library RLP {
if (b0 < DATA_SHORT_START) { if (b0 < DATA_SHORT_START) {
memPtr = start; memPtr = start;
len = 1; len = 1;
return;
} }
if (b0 < DATA_LONG_START) { else if (b0 < DATA_LONG_START) {
len = self._unsafe_length - 1; len = self._unsafe_length - 1;
memPtr = start + 1; memPtr = start + 1;
} else { } else {
@ -372,7 +371,6 @@ library RLP {
len = self._unsafe_length - 1 - bLen; len = self._unsafe_length - 1 - bLen;
memPtr = start + bLen + 1; memPtr = start + bLen + 1;
} }
return;
} }
// Assumes that enough memory has been allocated to store in target. // Assumes that enough memory has been allocated to store in target.

View File

@ -199,7 +199,7 @@ contract multiowned {
// determine what index the present sender is: // determine what index the present sender is:
uint ownerIndex = m_ownerIndex[uint(msg.sender)]; uint ownerIndex = m_ownerIndex[uint(msg.sender)];
// make sure they're an owner // make sure they're an owner
if (ownerIndex == 0) return; if (ownerIndex == 0) return false;
PendingState storage pending = m_pending[_operation]; PendingState storage pending = m_pending[_operation];
// if we're not yet working on this operation, switch over and reset the confirmation status. // if we're not yet working on this operation, switch over and reset the confirmation status.
@ -228,6 +228,7 @@ contract multiowned {
// not enough: record that this owner in particular confirmed. // not enough: record that this owner in particular confirmed.
pending.yetNeeded--; pending.yetNeeded--;
pending.ownersDone |= ownerIndexBit; pending.ownersDone |= ownerIndexBit;
return false;
} }
} }
} }