|
|
|
@ -34,6 +34,7 @@ using System.Windows.Threading;
@@ -34,6 +34,7 @@ using System.Windows.Threading;
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.Decompiler.TypeSystem; |
|
|
|
|
using ICSharpCode.ILSpy.Docking; |
|
|
|
|
using ICSharpCode.ILSpy.Options; |
|
|
|
|
using ICSharpCode.ILSpy.Search; |
|
|
|
|
using ICSharpCode.ILSpy.ViewModels; |
|
|
|
|
|
|
|
|
@ -253,30 +254,11 @@ namespace ICSharpCode.ILSpy
@@ -253,30 +254,11 @@ namespace ICSharpCode.ILSpy
|
|
|
|
|
|
|
|
|
|
void InsertResult(IList<SearchResult> results, SearchResult result) |
|
|
|
|
{ |
|
|
|
|
if (results.Count == 0) |
|
|
|
|
{ |
|
|
|
|
results.Add(result); |
|
|
|
|
} |
|
|
|
|
else if (Options.DisplaySettingsPanel.CurrentDisplaySettings.SortResults) |
|
|
|
|
{ |
|
|
|
|
// Keep results collection sorted by "Fitness" by inserting result into correct place
|
|
|
|
|
// Inserts in the beginning shifts all elements, but there can be no more than 1000 items.
|
|
|
|
|
for (int i = 0; i < results.Count; i++) |
|
|
|
|
{ |
|
|
|
|
if (results[i].Fitness < result.Fitness) |
|
|
|
|
{ |
|
|
|
|
results.Insert(i, result); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
results.Add(result); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Original Code
|
|
|
|
|
int index = results.BinarySearch(result, 0, results.Count - 1, SearchResult.Comparer); |
|
|
|
|
results.Insert(index < 0 ? ~index : index, result); |
|
|
|
|
} |
|
|
|
|
var comparer = DisplaySettingsPanel.CurrentDisplaySettings.SortResults ? |
|
|
|
|
SearchResult.ComparerByFitness : |
|
|
|
|
SearchResult.ComparerByName; |
|
|
|
|
|
|
|
|
|
results.InsertSorted(result, comparer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void JumpToSelectedItem() |
|
|
|
|