Skip to content

Commit 360f730

Browse files
authored
Use LINQ .Where to filter (CodeQL suggestion) (#95)
1 parent 9b4228d commit 360f730

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Engine/DiaUtil.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ internal static bool LocateandLoadPDBs(Dictionary<string, DiaUtil> _diautils, st
7474
}
7575

7676
// if needed, make a last attempt looking for the original module name - but only amongst user-supplied symbol path folder(s)
77-
if (!foundFiles.Any()) foreach (var currPath in userSuppliedSymPath.Split(';').Where(p => Directory.Exists(p))) {
78-
if (!currPath.EndsWith(currentModule)) foundFiles = Directory.EnumerateFiles(currPath, moduleNamesMap[currentModule] + ".pdb", recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
77+
if (!foundFiles.Any()) foreach (var currPath in userSuppliedSymPath.Split(';').Where(p => Directory.Exists(p) && !p.EndsWith(currentModule))) {
78+
foundFiles = Directory.EnumerateFiles(currPath, moduleNamesMap[currentModule] + ".pdb", recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
7979
}
8080

8181
if (foundFiles?.Count() == 1) { // we need to be sure there is only 1 file which matches

Engine/ModuleInfoHelper.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ await Task.Run(() => Parallel.ForEach(listOfCallStacks, currItem => {
109109
}
110110
lock (syms) {
111111
if (syms.TryGetValue(uniqueModuleName, out var existingEntry)) {
112-
//if (Guid.Parse(reader.GetAttribute("guid")).ToString("N") != existingEntry.PDBGuid || int.Parse(reader.GetAttribute("age")) != existingEntry.PDBAge) {
113-
// anyTaskFailed = true;
114-
// return;
115-
//}
116112
if (ulong.MinValue == existingEntry.CalculatedModuleBaseAddress) existingEntry.CalculatedModuleBaseAddress = calcBaseAddress;
117113
} else syms.Add(uniqueModuleName, new Symbol() { PDBName = reader.GetAttribute("pdb").ToLower(), ModuleName = moduleName, PDBAge = int.Parse(pdbAge), PDBGuid = Guid.Parse(pdbGuid).ToString("N").ToUpper(), CalculatedModuleBaseAddress = calcBaseAddress });
118114
}

0 commit comments

Comments
 (0)