]> git.donarmstrong.com Git - lilypond.git/commitdiff
Mostly cosmetic music function changes.
authorDavid Kastrup <dak@gnu.org>
Tue, 14 Feb 2012 20:36:14 +0000 (21:36 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 15 Feb 2012 05:45:30 +0000 (06:45 +0100)
Avoids creating empty elements field in music-map.

scm/music-functions.scm

index 660c0a1c4440d6eaa0370990bb026fcd588d1752..361dc92b95617607b3e7eae63982a07f69598cea 100644 (file)
@@ -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)))