Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Issue 6215069: Fix 2546: Prefix incrementers may be preferred for (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by Colin Campbell
Modified:
11 years, 3 months ago
Reviewers:
Keith
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Fix 2546: Prefix incrementers may be preferred for See http://en.allexperts.com/q/C-1040/Increment-operators.htm for some explanation

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -18 lines) Patch
M lily/dot-column.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/dot-configuration.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/note-spacing-engraver.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/skyline.cc View 6 chunks +7 lines, -7 lines 0 comments Download
M lily/tie-engraver.cc View 2 chunks +2 lines, -2 lines 1 comment Download
M lily/tie-formatting-problem.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/tie-performer.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 1
Keith
11 years, 11 months ago (2012-05-21 05:55:18 UTC) #1
Yuck, but harmless.

http://codereview.appspot.com/6215069/diff/1/lily/tie-engraver.cc
File lily/tie-engraver.cc (right):

http://codereview.appspot.com/6215069/diff/1/lily/tie-engraver.cc#newcode240
lily/tie-engraver.cc:240: for (; it != heads_to_tie_.end (); ++it)
The vector iterator supports < and that makes a more-recognizable loop idiom,
but I guess != would work as well.

The post-fix version is more common in loops so humans read it more quickly.  I
guess the pre-fix version promises makes it easier for the compiler to see we
don't need the value before the increment.  Humans are more important than
compilers.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b