Upload FastSeekWpf/Core/SearchEngine.cs
Browse files
FastSeekWpf/Core/SearchEngine.cs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
using System;
|
| 2 |
using System.Collections.Generic;
|
| 3 |
using System.IO;
|
|
|
|
| 4 |
using System.Text;
|
| 5 |
|
| 6 |
namespace FastSeekWpf.Core;
|
|
@@ -188,7 +189,7 @@ public static class SearchEngine
|
|
| 188 |
if (dotIdx >= 0)
|
| 189 |
{
|
| 190 |
string ext = nameLower[(dotIdx + 1)..];
|
| 191 |
-
if (
|
| 192 |
rank = 0;
|
| 193 |
}
|
| 194 |
}
|
|
@@ -271,8 +272,8 @@ public static class SearchEngine
|
|
| 271 |
private static string BuildPathFast(IndexStore store, ulong fileRef, StringBuilder sb)
|
| 272 |
{
|
| 273 |
sb.Clear();
|
| 274 |
-
//
|
| 275 |
-
|
| 276 |
int compCount = 0;
|
| 277 |
ulong current = fileRef;
|
| 278 |
|
|
|
|
| 1 |
using System;
|
| 2 |
using System.Collections.Generic;
|
| 3 |
using System.IO;
|
| 4 |
+
using System.Linq;
|
| 5 |
using System.Text;
|
| 6 |
|
| 7 |
namespace FastSeekWpf.Core;
|
|
|
|
| 189 |
if (dotIdx >= 0)
|
| 190 |
{
|
| 191 |
string ext = nameLower[(dotIdx + 1)..];
|
| 192 |
+
if (Array.IndexOf(AppExtensions, ext) >= 0 && ContainsAny(fullPathLower, AppPathMarkers))
|
| 193 |
rank = 0;
|
| 194 |
}
|
| 195 |
}
|
|
|
|
| 272 |
private static string BuildPathFast(IndexStore store, ulong fileRef, StringBuilder sb)
|
| 273 |
{
|
| 274 |
sb.Clear();
|
| 275 |
+
// string is a managed type, can't stackalloc it. Use small heap array.
|
| 276 |
+
string[] components = new string[64];
|
| 277 |
int compCount = 0;
|
| 278 |
ulong current = fileRef;
|
| 279 |
|