Skip to content

Commit 3083b36

Browse files
committed
Simplify memory dump method.
1 parent 95309e8 commit 3083b36

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Hexa.NET.ImGui.Widgets/Dialogs/FileUtilities.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -581,20 +581,13 @@ private static FileMetadata Convert(DirEnt entry, StdString path)
581581
for (int i = 0; i < sizeInBytes; i++)
582582
{
583583
(FieldInfo info, int offset, int size)? info = default;
584-
for (int k = startInfo; k < offsetData.Length; k++)
584+
585+
if (startInfo < offsetData.Length && offsetData[startInfo].offset == i)
585586
{
586-
var x = offsetData[k];
587-
if (x.offset == i)
588-
{
589-
startInfo = k;
590-
info = x;
591-
break;
592-
}
593-
if (x.offset > i)
594-
{
595-
break;
596-
}
587+
info = offsetData[startInfo];
588+
startInfo++;
597589
}
590+
598591
if (info.HasValue)
599592
{
600593
Console.WriteLine($"{((nint)p + i):X8}: {p[i]:X} : {info.Value.info.Name} {info.Value.size}");

0 commit comments

Comments
 (0)