X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcontext.cc;h=9e99577019660272cbbc5c1bdc66c7e1dcea7030;hb=b872748c6aa8bb721ced458691b38ac2fac5dfc8;hp=7dce3857cec672243312ec9a6defa0b58fc63cc5;hpb=feedaf62a490820021a83b7096a3fda1884beaf6;p=lilypond.git diff --git a/lily/context.cc b/lily/context.cc index 7dce3857ce..9e99577019 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -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; }