Skip to content

Commit ef2aa59

Browse files
authored
Merge pull request #13115 from denis-t-dev/patch-1
Fix comment position in the voting example
2 parents 9b220a2 + 811fa19 commit ef2aa59

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/examples/voting.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,17 @@ of votes.
128128
// We found a loop in the delegation, not allowed.
129129
require(to != msg.sender, "Found loop in delegation.");
130130
}
131-
132-
// Since `sender` is a reference, this
133-
// modifies `voters[msg.sender].voted`
131+
134132
Voter storage delegate_ = voters[to];
135133
136134
// Voters cannot delegate to accounts that cannot vote.
137135
require(delegate_.weight >= 1);
136+
137+
// Since `sender` is a reference, this
138+
// modifies `voters[msg.sender]`.
138139
sender.voted = true;
139140
sender.delegate = to;
141+
140142
if (delegate_.voted) {
141143
// If the delegate already voted,
142144
// directly add to the number of votes

0 commit comments

Comments
 (0)