[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lilypond-auto] Issue 2545 in lilypond: Possible emptiness check ineffic
[Lilypond-auto] Issue 2545 in lilypond: Possible emptiness check inefficiency
Fri, 18 May 2012 22:10:42 +0000
New issue 2545 by address@hidden: Possible emptiness check
As reported by Julien Nabet, cppcheck reports that a standard idiom used in
LilyPond to check for an empty vector may be inefficient.
Also, in one particular case, (lily/tie-engraver.cc), Julien claims a
different while contition (!= instead of <) would be better.
322 if (!wait && new_heads_to_tie.size ())
324 vector<Head_event_tuple>::iterator it = heads_to_tie_.begin ();
325 for (; it < heads_to_tie_.end (); it++)
326 report_unterminated_tie (*it);
327 heads_to_tie_.clear ();
I have attached a listing of the cppcheck output. Note that the line
numbers will change if the source files change, but the relevant lines can
be found by searching for "size ()"
emptiness.txt 6.3 KB
- [Lilypond-auto] Issue 2545 in lilypond: Possible emptiness check inefficiency,