1
1
use ahash:: { AHashMap , RandomState } ;
2
2
use cxx:: UniquePtr ;
3
3
use glob_match:: glob_match;
4
+ use indexmap:: map:: Entry ;
4
5
use indicium:: simple:: { Indexable , SearchIndex } ;
5
6
use memchr:: memmem;
6
7
use oma_apt:: {
@@ -9,9 +10,10 @@ use oma_apt::{
9
10
raw:: { IntoRawIter , PkgIterator } ,
10
11
Package , Version ,
11
12
} ;
12
- use std:: { collections :: hash_map :: Entry , fmt:: Debug } ;
13
+ use std:: fmt:: Debug ;
13
14
14
15
type IndexSet < T > = indexmap:: IndexSet < T , RandomState > ;
16
+ type IndexMap < K , V > = indexmap:: IndexMap < K , V , RandomState > ;
15
17
16
18
use crate :: {
17
19
format_description,
@@ -119,7 +121,7 @@ pub struct SearchResult {
119
121
120
122
pub struct IndiciumSearch < ' a > {
121
123
cache : & ' a Cache ,
122
- pkg_map : AHashMap < String , SearchEntry > ,
124
+ pkg_map : IndexMap < String , SearchEntry > ,
123
125
index : SearchIndex < String > ,
124
126
}
125
127
@@ -160,7 +162,7 @@ impl<'a> IndiciumSearch<'a> {
160
162
let sort = PackageSort :: default ( ) . include_virtual ( ) ;
161
163
let packages = cache. packages ( & sort) ;
162
164
163
- let mut pkg_map = AHashMap :: new ( ) ;
165
+ let mut pkg_map = IndexMap :: with_hasher ( RandomState :: new ( ) ) ;
164
166
165
167
for ( i, pkg) in packages. enumerate ( ) {
166
168
let name = pkg. fullname ( true ) ;
0 commit comments