Change HashMap to BTreeMap.

This commit is contained in:
Stephen Chung
2021-03-23 12:13:53 +08:00
parent 7a0032fc89
commit f70225ca1d
19 changed files with 139 additions and 214 deletions

View File

@@ -1,6 +1,6 @@
use crate::stdlib::{
boxed::Box,
collections::HashMap,
collections::BTreeMap,
io::Error as IoError,
path::{Path, PathBuf},
string::String,
@@ -44,9 +44,9 @@ pub struct FileModuleResolver {
cache_enabled: bool,
#[cfg(not(feature = "sync"))]
cache: crate::stdlib::cell::RefCell<HashMap<PathBuf, Shared<Module>>>,
cache: crate::stdlib::cell::RefCell<BTreeMap<PathBuf, Shared<Module>>>,
#[cfg(feature = "sync")]
cache: crate::stdlib::sync::RwLock<HashMap<PathBuf, Shared<Module>>>,
cache: crate::stdlib::sync::RwLock<BTreeMap<PathBuf, Shared<Module>>>,
}
impl Default for FileModuleResolver {