From 98afde57a6d72294c6fdedad4e1ff093b9bf5706 Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Thu, 22 Sep 2011 09:51:00 +0200 Subject: [PATCH] Prunes down stem::length to bare minimum. Removes unnecessary property lookups and replaces code that should never get called with a programming error. --- scm/output-lib.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)))) -- 2.39.5