Skip to content

Commit

Permalink
Move add namespace into new method
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed Jun 25, 2012
1 parent 1041e92 commit 4c76782
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mcs/mcs/namespace.cs
Expand Up @@ -209,10 +209,16 @@ public Namespace AddNamespace (MemberName name)
ns_parent = this;
}

return ns_parent.TryAddNamespace (name.Basename);
}

Namespace TryAddNamespace (string name)
{
Namespace ns;
if (!ns_parent.namespaces.TryGetValue (name.Basename, out ns)) {
ns = new Namespace (ns_parent, name.Basename);
ns_parent.namespaces.Add (name.Basename, ns);

if (!namespaces.TryGetValue (name, out ns)) {
ns = new Namespace (this, name);
namespaces.Add (name, ns);
}

return ns;
Expand Down

0 comments on commit 4c76782

Please sign in to comment.