mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use new style for the docs
This commit is contained in:
parent
f1e6bc2eaa
commit
532266b89e
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
...
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user