]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context.cc
Release: bump Welcome versions.
[lilypond.git] / lily / context.cc
index 7dce3857cec672243312ec9a6defa0b58fc63cc5..9e99577019660272cbbc5c1bdc66c7e1dcea7030 100644 (file)
@@ -674,11 +674,12 @@ find_context_above (Context *where, SCM type)
 Context *
 find_context_above_by_parent_type (Context *where, SCM parent_type)
 {
-  for (Context *child = 0; where;
-       child = where, where = where->get_parent_context ())
-    if (where->is_alias (parent_type))
-      return child;
-
+  while (Context *parent = where->get_parent_context ())
+    {
+      if (parent->is_alias (parent_type))
+        return where;
+      where = parent;
+    }
   return 0;
 }