hi Bertrand,

the patch is correct, AFAICS; see some minor improvements below.


minor concerns (which shouldn't delay acception):
1. about the very existence of usable-duration-logs -
   ok, it's generic, but who uses this genericity?
   is it not always (0 -1 -2 -3)?
   is it not always a range with lower end -3?
   is it not always a range?
2. comments, more descriptive names, e.g.
   round_up instead of round in calc_measure_duration_log;
   measure_count instead of measures (and l),
   symbol_count instead of count in church_rest


http://codereview.appspot.com/4536068/diff/37004/lily/multi-measure-rest.cc
File lily/multi-measure-rest.cc (right):

http://codereview.appspot.com/4536068/diff/37004/lily/multi-measure-rest.cc#newcode163
lily/multi-measure-rest.cc:163: closest_usable_duration_log =
minimum_usable_duration_log;
I think these two lines can be moved after the loop

http://codereview.appspot.com/4536068/diff/37004/lily/multi-measure-rest.cc#newcode257
lily/multi-measure-rest.cc:257: int mdl = calc_measure_duration_log
(me);
move this before the loop

http://codereview.appspot.com/4536068/diff/37004/lily/multi-measure-rest.cc#newcode268
lily/multi-measure-rest.cc:268: k = mdl + i;
I'd write lines 254-268 like

    /*
      find the longest usable rest fitting into l:
      k identifies a canditate by its duration-log,
      length is its duration (in mdl units)
    */
    int k = longest_church_rest;
    int length = 1 << (mdl - k);
    for (; length > l; ++k)
      length >>= 1;

    l -= length;

http://codereview.appspot.com/4536068/

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to