Skip to content

Commit 5d03406

Browse files
committed
Replaced type check + type cast using 'is' operator with type cast using 'as'
and null-propagation. Reduced nesting. Replaced explicit type declarations with 'var'. Added parameter name for second argument in call to FindExportName().
1 parent 14fd98f commit 5d03406

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

PmipRunner.cs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,13 @@ private bool TryGetPmipFunction(out PmipFunctionDataItem pmipFunction)
6161

6262
foreach (var module in this._frame.RuntimeInstance.GetModuleInstances())
6363
{
64-
if (module is DkmNativeModuleInstance)
65-
{
66-
DkmNativeInstructionAddress address = ((DkmNativeModuleInstance) module).FindExportName("mono_pmip", true);
67-
if (address != null)
68-
{
69-
PmipFunctionDataItem item = new PmipFunctionDataItem { PmipFunction = "0x" + address.CPUInstructionPart.InstructionPointer.ToString("X") };
70-
pmipFunction = item;
71-
_stackContext.SetDataItem(DkmDataCreationDisposition.CreateAlways, item);
72-
return true;
73-
}
74-
}
64+
var address = (module as DkmNativeModuleInstance)?.FindExportName("mono_pmip", IgnoreDataExports: true);
65+
if (address == null)
66+
continue;
67+
var item = new PmipFunctionDataItem { PmipFunction = "0x" + address.CPUInstructionPart.InstructionPointer.ToString("X") };
68+
pmipFunction = item;
69+
_stackContext.SetDataItem(DkmDataCreationDisposition.CreateAlways, item);
70+
return true;
7571
}
7672

7773
return false;

0 commit comments

Comments
 (0)