@@ -59,7 +59,6 @@ public static async ValueTask<bool> IsEverythingRunningAsync(CancellationToken t
59
59
{
60
60
EverythingApiDllImport . Everything_GetMajorVersion ( ) ;
61
61
var result = EverythingApiDllImport . Everything_GetLastError ( ) != StateCode . IPCError ;
62
-
63
62
return result ;
64
63
}
65
64
finally
@@ -68,8 +67,6 @@ public static async ValueTask<bool> IsEverythingRunningAsync(CancellationToken t
68
67
}
69
68
}
70
69
71
- const int ScoreScaleFactor = 5 ;
72
-
73
70
/// <summary>
74
71
/// Searches the specified key word and reset the everything API afterwards
75
72
/// </summary>
@@ -118,7 +115,7 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
118
115
119
116
EverythingApiDllImport . Everything_SetSort ( option . SortOption ) ;
120
117
EverythingApiDllImport . Everything_SetMatchPath ( option . IsFullPathSearch ) ;
121
-
118
+
122
119
if ( option . SortOption == SortOption . RUN_COUNT_DESCENDING )
123
120
{
124
121
EverythingApiDllImport . Everything_SetRequestFlags ( EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME | EVERYTHING_REQUEST_RUN_COUNT ) ;
@@ -135,13 +132,10 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
135
132
if ( ! EverythingApiDllImport . Everything_QueryW ( true ) )
136
133
{
137
134
CheckAndThrowExceptionOnError ( ) ;
138
-
139
135
yield break ;
140
136
}
141
137
142
- var numResults = EverythingApiDllImport . Everything_GetNumResults ( ) ;
143
-
144
- for ( var idx = 0 ; idx < numResults ; ++ idx )
138
+ for ( var idx = 0 ; idx < EverythingApiDllImport . Everything_GetNumResults ( ) ; ++ idx )
145
139
{
146
140
if ( token . IsCancellationRequested )
147
141
{
@@ -157,8 +151,7 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
157
151
Type = EverythingApiDllImport . Everything_IsFolderResult ( idx ) ? ResultType . Folder :
158
152
EverythingApiDllImport . Everything_IsFileResult ( idx ) ? ResultType . File :
159
153
ResultType . Volume ,
160
- Score = ( option . SortOption is SortOption . RUN_COUNT_DESCENDING ? ( int ) EverythingApiDllImport . Everything_GetResultRunCount ( ( uint ) idx ) : 0 ) * ScoreScaleFactor ,
161
- WindowsIndexed = false
154
+ Score = ( int ) EverythingApiDllImport . Everything_GetResultRunCount ( ( uint ) idx )
162
155
} ;
163
156
164
157
yield return result ;
@@ -199,7 +192,6 @@ private static void CheckAndThrowExceptionOnError()
199
192
public static async Task IncrementRunCounterAsync ( string fileOrFolder )
200
193
{
201
194
await _semaphore . WaitAsync ( TimeSpan . FromSeconds ( 1 ) ) ;
202
-
203
195
try
204
196
{
205
197
_ = EverythingApiDllImport . Everything_IncRunCountFromFileName ( fileOrFolder ) ;
0 commit comments