]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context-def.cc
* lily/timing-engraver.cc (process_music): robustness fix.
[lilypond.git] / lily / context-def.cc
index 858ef35ff94264b337e1031e43604cf9d88d78f6..b5d0d940cc8f0fd7e76a6c043f96a39a22e61dc1 100644 (file)
@@ -265,14 +265,13 @@ Context_def::get_translator_names (SCM user_mod) const
 SCM
 filter_performers (SCM ell)
 {
-  for (SCM *tail = ℓ scm_is_pair (*tail); tail = SCM_CDRLOC (*tail))
+  SCM *tail = ℓ
+  for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
     {
       if (dynamic_cast<Performer *> (unsmob_translator (scm_car (*tail))))
-       {
-         *tail = scm_cdr (*tail);
-         if (!scm_is_pair (*tail))
-           break;
-       }
+       *tail = scm_cdr (*tail);
+      else
+       tail = SCM_CDRLOC(*tail);
     }
   return ell;
 }
@@ -281,14 +280,12 @@ SCM
 filter_engravers (SCM ell)
 {
   SCM *tail = &ell;
-  for (; scm_is_pair (*tail); tail = SCM_CDRLOC (*tail))
+  for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
     {
       if (dynamic_cast<Engraver *> (unsmob_translator (scm_car (*tail))))
-       {
-         *tail = scm_cdr (*tail);
-         if (!scm_is_pair (*tail))
-           break;
-       }
+       *tail = scm_cdr (*tail);
+      else
+       tail = SCM_CDRLOC(*tail);
     }
   return ell;
 }