]> git.donarmstrong.com Git - lilypond.git/commitdiff
Prunes down stem::length to bare minimum.
authorMike Solomon <mike@apollinemike.com>
Thu, 22 Sep 2011 07:51:00 +0000 (09:51 +0200)
committerMike Solomon <mike@apollinemike.com>
Thu, 22 Sep 2011 07:51:00 +0000 (09:51 +0200)
Removes unnecessary property lookups and replaces code that should
never get called with a programming error.

scm/output-lib.scm

index 70e3ba3eeb07885ff46475ec6f20b2a841dd01f8..33a2df36a70afcec5747ebaca2363028786e26a8 100644 (file)
    (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))))