[MonoDevelop] Strange escape algorithm
Jeffrey Stedfast
fejj at novell.com
Thu Jan 22 08:24:54 EST 2009
Vadim Chekan wrote:
> 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)
>
>
>
I think I probably wrote the original code, which was basically just a
brain-dead port from some old C code, not really knowing about nifty
String APIs like the one used above :)
This patch is probably fine, but Michael Hutchinson or Lluis should confirm.
Jeff
More information about the Monodevelop-list
mailing list