From 19136e03cea19f4956d7b36935279b7975383049 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 14 Feb 2012 21:36:14 +0100 Subject: [PATCH] Mostly cosmetic music function changes. Avoids creating empty elements field in music-map. --- scm/music-functions.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 660c0a1c44..361dc92b95 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -62,8 +62,9 @@ First it recurses over the children, then the function is applied to @var{music}." (let ((es (ly:music-property music 'elements)) (e (ly:music-property music 'element))) - (set! (ly:music-property music 'elements) - (map (lambda (y) (music-map function y)) es)) + (if (pair? es) + (set! (ly:music-property music 'elements) + (map (lambda (y) (music-map function y)) es))) (if (ly:music? e) (set! (ly:music-property music 'element) (music-map function e))) @@ -311,8 +312,7 @@ through MUSIC." calculate the number of slashes based on the durations. Returns @code{0} if durations in @var{music} vary, allowing slash beats and double-percent beats to be distinguished." - (let* ((durs (map (lambda (elt) - (duration-of-note elt)) + (let* ((durs (map duration-of-note (extract-named-music music '(EventChord NoteEvent RestEvent SkipEvent)))) (first-dur (car durs))) -- 2.39.2