11use std:: collections:: BTreeMap ;
2- use std:: collections:: HashMap ;
32use std:: convert:: { TryFrom , TryInto } ;
43use std:: fs:: { read_dir, remove_dir, remove_file, rename, DirBuilder , File , FileType , OpenOptions , ReadDir } ;
54use std:: io:: { Read , Seek , SeekFrom , Write } ;
65use std:: path:: PathBuf ;
76use std:: time:: SystemTime ;
87
8+ use rustc_data_structures:: fx:: FxHashMap ;
99use rustc:: ty:: layout:: { Align , LayoutOf , Size } ;
1010
1111use crate :: stacked_borrows:: Tag ;
@@ -212,10 +212,10 @@ pub struct DirHandler {
212212 /// When opendir is called, a directory iterator is created on the host for the target
213213 /// directory, and an entry is stored in this hash map, indexed by an ID which represents
214214 /// the directory stream. When readdir is called, the directory stream ID is used to look up
215- /// the corresponding ReadDir iterator from this HashMap , and information from the next
215+ /// the corresponding ReadDir iterator from this map , and information from the next
216216 /// directory entry is returned. When closedir is called, the ReadDir iterator is removed from
217- /// this HashMap .
218- streams : HashMap < u64 , ReadDir > ,
217+ /// the map .
218+ streams : FxHashMap < u64 , ReadDir > ,
219219 /// ID number to be used by the next call to opendir
220220 next_id : u64 ,
221221}
@@ -232,7 +232,7 @@ impl DirHandler {
232232impl Default for DirHandler {
233233 fn default ( ) -> DirHandler {
234234 DirHandler {
235- streams : HashMap :: new ( ) ,
235+ streams : FxHashMap :: default ( ) ,
236236 // Skip 0 as an ID, because it looks like a null pointer to libc
237237 next_id : 1 ,
238238 }
0 commit comments