From ce0b82ea7a19957ad3796e7e9a92e393bf6e30cc Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 11 Nov 2022 12:15:52 -0300 Subject: [PATCH] remove unnecessary code (#78171) --- .../debugger/BrowserDebugProxy/DebugStore.cs | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs index effd7e06e451d..32727996e9840 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs @@ -1186,8 +1186,7 @@ internal SourceFile(AssemblyInfo assembly, int id, DocumentHandle docHandle, Uri this.DebuggerFileName = url.Replace("\\", "/").Replace(":", ""); this.BreakableLines = new List(); - var urlWithSpecialCharCodedHex = EscapeAscii(url); - this.SourceUri = new Uri((Path.IsPathRooted(url) ? "file://" : "") + urlWithSpecialCharCodedHex, UriKind.RelativeOrAbsolute); + this.SourceUri = new Uri((Path.IsPathRooted(url) ? "file://" : "") + url, UriKind.RelativeOrAbsolute); if (SourceUri.IsFile && File.Exists(SourceUri.LocalPath)) { this.Url = this.SourceUri.ToString(); @@ -1198,33 +1197,6 @@ internal SourceFile(AssemblyInfo assembly, int id, DocumentHandle docHandle, Uri } } - private static string EscapeAscii(string path) - { - var builder = new StringBuilder(); - foreach (char c in path) - { - switch (c) - { - case var _ when c >= 'a' && c <= 'z': - case var _ when c >= 'A' && c <= 'Z': - case var _ when char.IsDigit(c): - case var _ when c > 255: - case var _ when c == '+' || c == ':' || c == '.' || c == '-' || c == '_' || c == '~': - builder.Append(c); - break; - case var _ when c == Path.DirectorySeparatorChar: - case var _ when c == Path.AltDirectorySeparatorChar: - case var _ when c == '\\': - builder.Append(c); - break; - default: - builder.AppendFormat("%{0:X2}", (int)c); - break; - } - } - return builder.ToString(); - } - internal void AddMethod(MethodInfo mi) { if (!this.methods.ContainsKey(mi.Token))