Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/debugger-libs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Mono.Debugging/Mono.Debugging.Client/SourceLink.cs')
-rw-r--r--Mono.Debugging/Mono.Debugging.Client/SourceLink.cs25
1 files changed, 1 insertions, 24 deletions
diff --git a/Mono.Debugging/Mono.Debugging.Client/SourceLink.cs b/Mono.Debugging/Mono.Debugging.Client/SourceLink.cs
index 9c78393..56cde15 100644
--- a/Mono.Debugging/Mono.Debugging.Client/SourceLink.cs
+++ b/Mono.Debugging/Mono.Debugging.Client/SourceLink.cs
@@ -1,17 +1,11 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
-using System.Text;
namespace Mono.Debugging.Client
{
[Serializable]
public class SourceLink
{
- // Keep the / character to use as a path separator to help group related symbols
- static readonly HashSet<char> invalids = new HashSet<char>(Path.GetInvalidFileNameChars ().Except (new char[] { '/' }));
-
public string Uri { get; }
public string RelativeFilePath { get; }
@@ -25,24 +19,7 @@ namespace Mono.Debugging.Client
public string GetDownloadLocation (string cachePath)
{
var uri = new Uri (Uri);
- return Path.Combine (cachePath, MakeValidFileName (uri));
- }
-
- static string MakeValidFileName (Uri uri)
- {
- // Remove scheme from uri
- var text = uri.Host + uri.PathAndQuery;
- var sb = new StringBuilder (text.Length);
- for (int i = 0; i < text.Length; i++) {
- char c = text[i];
- if (invalids.Contains (c)) {
- sb.Append ('_');
- } else
- sb.Append (c);
- }
- if (sb.Length == 0)
- return "_";
- return sb.ToString ();
+ return Path.Combine (cachePath, uri.Host + uri.PathAndQuery);
}
}
}