https://codereview.appspot.com/551730043/diff/583770043/lily/stencil-integral.cc
File lily/stencil-integral.cc (right):

https://codereview.appspot.com/551730043/diff/583770043/lily/stencil-integral.cc#newcode496
lily/stencil-integral.cc:496: break;
I think that is less readable than desirable.  Instead how about putting

if (th == 0.0)
   break;

behind the push?  That makes very obvious that only one point is being
pushed without further cleverness.

Either way you'll be checking thickness twice if its non-zero.  The
trivial way to avoid that would be to simply unfold the loop.  Like

points[DOWN].push_back (scm_transform (trans, curve.control_[0] + DOWN *
normal);
if (th != 0.0)
  points[UP].push_back (scm_transform (trans, curve.control_[0] + UP *
normal;

Written like that, it actually becomes far from trivial to see why this
optimisation would be valid, so maybe add a comment explaining it for
the sake of human readers?

https://codereview.appspot.com/551730043/

Reply via email to