[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lilypond-auto] Issue 2545 in lilypond: Possible emptiness check ineffic

From: lilypond
Subject: [Lilypond-auto] Issue 2545 in lilypond: Possible emptiness check inefficiency
Date: Fri, 18 May 2012 22:10:42 +0000

Status: Accepted
Owner: ----

New issue 2545 by address@hidden: Possible emptiness check inefficiency

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/, Julien claims a different while contition (!= instead of <) would be better.

322   if (!wait && new_heads_to_tie.size ())
323     {
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 ();
328     }

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]