[MonoDevelop] Strange escape algorithm

Vadim Chekan kot.begemot at gmail.com
Thu Jan 22 03:26:38 EST 2009


Folks,
Am I missing something or escape algorithm was/will be more
complicated then it is now?

Vadim.

Index: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs
===================================================================
--- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs	(revision
124156)
+++ main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs	(working
copy)
@@ -248,17 +248,7 @@
 		
 		string EscapeName (string name)
 		{
-			if (name.IndexOf ('_') == -1)
-				return name;
-			
-			StringBuilder sb = new StringBuilder ();
-			for (int i = 0; i < name.Length; i++) {
-				if (name[i] == '_')
-					sb.Append ('_');
-				sb.Append (name[i]);
-			}
-			
-			return sb.ToString ();
+			return name.Replace("_", "__");
 		}
 		
 		CommandInfo BuildRefactoryMenuForItem (ProjectDom ctx,
ICompilationUnit pinfo, IType eclass, IDomVisitable item, bool
includeModifyCommands)


-- 
>From RFC 2631: In ASN.1, EXPLICIT tagging is implicit unless IMPLICIT
is explicitly specified


More information about the Monodevelop-list mailing list