Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(186)

Unified Diff: lily/context-scheme.cc

Issue 344050043: Issue 5362: Generalize context searches (Closed)
Patch Set: ditch templates Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lily/context.cc ('k') | lily/context-specced-music-iterator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lily/context-scheme.cc
diff --git a/lily/context-scheme.cc b/lily/context-scheme.cc
index feda0f607eab62fffb45c2d770277b12114e814d..35213843f9f5799c844f2b3e68a78a2d44e083ff 100644
--- a/lily/context-scheme.cc
+++ b/lily/context-scheme.cc
@@ -187,15 +187,8 @@ LY_DEFINE (ly_context_find, "ly:context-find",
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, name, 2);
Context *tr = unsmob<Context> (context);
-
- while (tr)
- {
- if (tr->is_alias (name))
- return tr->self_scm ();
- tr = tr->get_parent_context ();
- }
-
- return SCM_BOOL_F;
+ tr = find_context_above (tr, name);
+ return tr ? tr->self_scm () : SCM_BOOL_F;
}
LY_DEFINE (ly_context_now, "ly:context-now",
« no previous file with comments | « lily/context.cc ('k') | lily/context-specced-music-iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b