C#: Address review comments. Replace GetHashValue() with MetadataTokens.GetToken().

C#: Make path IDs consistent.
This commit is contained in:
calum
2018-12-19 14:50:43 +00:00
parent efe2fb502e
commit d687dd9deb
10 changed files with 38 additions and 26 deletions

View File

@@ -16,8 +16,8 @@ namespace Semmle.Extraction.CIL.Entities
public File(Context cx, string path) : base(cx)
{
this.path = path.Replace("\\", "/");
ShortId = new StringId(path.Replace(":", "_"));
this.path = path;
ShortId = new StringId(Semmle.Extraction.Entities.File.PathAsDatabaseId(path));
}
public override IEnumerable<IExtractionProduct> Contents
@@ -27,7 +27,7 @@ namespace Semmle.Extraction.CIL.Entities
var parent = cx.CreateFolder(System.IO.Path.GetDirectoryName(path));
yield return parent;
yield return Tuples.containerparent(parent, this);
yield return Tuples.files(this, path, System.IO.Path.GetFileNameWithoutExtension(path), System.IO.Path.GetExtension(path).Substring(1));
yield return Tuples.files(this, Semmle.Extraction.Entities.File.PathAsDatabaseString(path), System.IO.Path.GetFileNameWithoutExtension(path), System.IO.Path.GetExtension(path).Substring(1));
}
}