Use new style for the docs

This commit is contained in:
Denton Liu 2016-08-24 15:28:07 -04:00
parent f1e6bc2eaa
commit 532266b89e
4 changed files with 10 additions and 14 deletions

View File

@ -45,8 +45,7 @@ become the new richest.
richest = msg.sender;
mostSent = msg.value;
return true;
}
else {
} else {
return false;
}
}
@ -58,8 +57,7 @@ become the new richest.
pendingWithdrawals[msg.sender] = 0;
if (msg.sender.send(amount)) {
return true;
}
else {
} else {
pendingWithdrawals[msg.sender] = amount;
return false;
}
@ -90,8 +88,7 @@ This is as opposed to the more intuitive sending pattern.
richest = msg.sender;
mostSent = msg.value;
return true;
}
else {
} else {
return false;
}
}

View File

@ -275,8 +275,7 @@ As a result, the following code is legal, despite being poorly written::
uint bar = 5;
if (true) {
bar += baz;
}
else {
} else {
uint baz = 10;// never executes
}
return bar;// returns 5

View File

@ -461,16 +461,17 @@ If you do not want to throw, you can return a pair::
function getCounter(uint index)
returns (uint counter, bool error) {
if (index >= counters.length) return (0, true);
else return (counters[index], false);
if (index >= counters.length)
return (0, true);
else
return (counters[index], false);
}
function checkCounter(uint index) {
var (counter, error) = getCounter(index);
if (error) {
...
}
else {
} else {
...
}
}

View File

@ -133,8 +133,7 @@ of votes.
// If the delegate already voted,
// directly add to the number of votes
proposals[delegate.vote].voteCount += sender.weight;
}
else {
} else {
// If the delegate did not vote yet,
// add to her weight.
delegate.weight += sender.weight;