From: Mike Solomon Date: Thu, 22 Sep 2011 07:51:00 +0000 (+0200) Subject: Prunes down stem::length to bare minimum. X-Git-Tag: release/2.15.13-1~37 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=98afde57a6d72294c6fdedad4e1ff093b9bf5706;p=lilypond.git Prunes down stem::length to bare minimum. Removes unnecessary property lookups and replaces code that should never get called with a programming error. --- diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 70e3ba3eeb..33a2df36a7 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -73,17 +73,16 @@ (ly:event-property (event-cause grob) 'duration))) (define-public (stem::length grob) - (let* ((d (ly:grob-property grob 'direction)) - (ss (ly:staff-symbol-staff-space grob)) + (let* ((ss (ly:staff-symbol-staff-space grob)) (beg (ly:grob-property grob 'stem-begin-position)) (beam (ly:grob-object grob 'beam))) (if (null? beam) (abs (- (ly:stem::calc-stem-end-position grob) beg)) - (ly:grob-property grob 'length)))) + (ly:programming-error + "stem::length called but will not be used for beamed stem.")))) (define-public (stem::pure-length grob beg end) - (let* ((d (ly:grob-property grob 'direction)) - (ss (ly:staff-symbol-staff-space grob)) + (let* ((ss (ly:staff-symbol-staff-space grob)) (beg (ly:grob-pure-property grob 'stem-begin-position 0 1000))) (abs (- (ly:stem::pure-calc-stem-end-position grob 0 2147483646) beg))))