[MonoDevelop] Strange escape algorithm

Federico Di Gregorio fog at initd.org
Thu Jan 22 03:47:40 EST 2009


Il giorno gio, 22/01/2009 alle 00.26 -0800, Vadim Chekan ha scritto:
> 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("_", "__");
>                 }

To me it seems the same as before but I don't have the time for a formal
proof. :)

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
            Bhoe, bhe, bhe. Sono brutto e cattivo. Brutto lama! -- Cuzco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio
	firmata digitalmente
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20090122/9386adc4/attachment.bin 


More information about the Monodevelop-list mailing list