From 07b23e6f84d16f0d8b0081adf14c56cf71085166 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Fri, 12 Jun 2015 01:21:14 +0300 Subject: [PATCH] Removed some redundant code when writing qualified names. Signed-off-by: Dimitar Dobrev --- .../Generators/CSharp/CSharpTextTemplate.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 0600a7d1..37372fc2 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -110,10 +110,9 @@ namespace CppSharp.Generators.CSharp // Takes a declaration (type, class etc.) that is referenced from a context, and the context. // If the referenced name needs a qualification in the context, add it. Otherwise, return just the name. - public string QualifiedIdentifierIfNeeded(Declaration context, Declaration reference) + private static string QualifiedIdentifierIfNeeded(Declaration reference) { var refNames = new Stack(); - var ctxNames = new Stack(); var refCtx = reference; while (refCtx != null) @@ -123,19 +122,6 @@ namespace CppSharp.Generators.CSharp refCtx = refCtx.Namespace; } - var ctxCtx = context; - while (ctxCtx != null) - { - if (!string.IsNullOrWhiteSpace(ctxCtx.Name)) - ctxNames.Push(ctxCtx.Name); - ctxCtx = ctxCtx.Namespace; - } - - if (context.GenerationKind == GenerationKind.Generate && Options.GenerateLibraryNamespace) - ctxNames.Push(Options.OutputNamespace); - if (reference.GenerationKind == GenerationKind.Generate && Options.GenerateLibraryNamespace) - refNames.Push(Options.OutputNamespace); - return string.Join(".", refNames); }