summaryrefslogtreecommitdiff
path: root/vala/valasemanticanalyzer.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-08-21 12:07:28 +0200
committerJürg Billeter <j@bitron.ch>2010-09-09 15:54:17 +0200
commitf870d093e3ad54bd2cbbdc35f958b69a24b2d2eb (patch)
treeb46670a6ef3e48d87107f730dc18b567015cbe88 /vala/valasemanticanalyzer.vala
parentdb40a8ea5c4ff623ae87e2cbe82e7b5d63926f7d (diff)
downloadvala-f870d093e3ad54bd2cbbdc35f958b69a24b2d2eb.tar.gz
Improve performance of SemanticAnalyzer.is_type_accessible
Diffstat (limited to 'vala/valasemanticanalyzer.vala')
-rw-r--r--vala/valasemanticanalyzer.vala11
1 files changed, 1 insertions, 10 deletions
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index e710912c5..db788fdc4 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -241,16 +241,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
// check whether type is at least as accessible as the specified symbol
public bool is_type_accessible (Symbol sym, DataType type) {
- foreach (Symbol type_symbol in type.get_symbols ()) {
- Scope method_scope = sym.get_top_accessible_scope ();
- Scope type_scope = type_symbol.get_top_accessible_scope ();
- if ((method_scope == null && type_scope != null)
- || (method_scope != null && !method_scope.is_subscope_of (type_scope))) {
- return false;
- }
- }
-
- return true;
+ return type.is_accessible (sym);
}
public DataType? get_value_type_for_symbol (Symbol sym, bool lvalue) {