aboutsummaryrefslogtreecommitdiffstats
path: root/docs/solidity-by-example.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/solidity-by-example.rst')
-rw-r--r--docs/solidity-by-example.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst
index 6c01278a..b663083c 100644
--- a/docs/solidity-by-example.rst
+++ b/docs/solidity-by-example.rst
@@ -158,9 +158,9 @@ of votes.
returns (uint winningProposal)
{
uint winningVoteCount = 0;
- for (uint p = 0; p < winningProposals.length; p++) {
- if (winningProposals[p].voteCount > winningVoteCount) {
- winningVoteCount = winningProposals[p].voteCount;
+ for (uint p = 0; p < proposals.length; p++) {
+ if (proposals[p].voteCount > winningVoteCount) {
+ winningVoteCount = proposals[p].voteCount;
winningProposal = p;
}
}
@@ -172,7 +172,7 @@ of votes.
function winnerName() public view
returns (bytes32 winnerName)
{
- name = proposals[winningProposal()].name;
+ winnerName = proposals[winningProposal()].name;
}
}