diff options
author | Jürg Billeter <j@bitron.ch> | 2010-08-21 12:07:28 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-09-09 15:54:17 +0200 |
commit | f870d093e3ad54bd2cbbdc35f958b69a24b2d2eb (patch) | |
tree | b46670a6ef3e48d87107f730dc18b567015cbe88 /vala/valasemanticanalyzer.vala | |
parent | db40a8ea5c4ff623ae87e2cbe82e7b5d63926f7d (diff) | |
download | vala-f870d093e3ad54bd2cbbdc35f958b69a24b2d2eb.tar.gz |
Improve performance of SemanticAnalyzer.is_type_accessible
Diffstat (limited to 'vala/valasemanticanalyzer.vala')
-rw-r--r-- | vala/valasemanticanalyzer.vala | 11 |
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) { |