Upload FastSeekWpf/Core/IndexStore.cs
Browse files
FastSeekWpf/Core/IndexStore.cs
CHANGED
|
@@ -103,7 +103,11 @@ public class IndexStore
|
|
| 103 |
|
| 104 |
foreach (var r in scan.Records)
|
| 105 |
{
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
string name = new string(nameChars);
|
| 108 |
string nameLower = name.ToLowerInvariant();
|
| 109 |
|
|
@@ -303,8 +307,8 @@ public class IndexStore
|
|
| 303 |
|
| 304 |
public string BuildPath(ulong fileRef)
|
| 305 |
{
|
| 306 |
-
//
|
| 307 |
-
|
| 308 |
int compCount = 0;
|
| 309 |
ulong current = fileRef;
|
| 310 |
|
|
|
|
| 103 |
|
| 104 |
foreach (var r in scan.Records)
|
| 105 |
{
|
| 106 |
+
int start = (int)r.NameOff;
|
| 107 |
+
int len = r.NameLen;
|
| 108 |
+
var nameChars = new char[len];
|
| 109 |
+
for (int i = 0; i < len; i++)
|
| 110 |
+
nameChars[i] = scan.NameData[start + i];
|
| 111 |
string name = new string(nameChars);
|
| 112 |
string nameLower = name.ToLowerInvariant();
|
| 113 |
|
|
|
|
| 307 |
|
| 308 |
public string BuildPath(ulong fileRef)
|
| 309 |
{
|
| 310 |
+
// string is a managed type, can't stackalloc it. Use small heap array.
|
| 311 |
+
string[] components = new string[64];
|
| 312 |
int compCount = 0;
|
| 313 |
ulong current = fileRef;
|
| 314 |
|