perf: use BTreeMap for ResourceTable (#10074)

This commit is contained in:
Aaron O'Mullan 2021-04-09 20:07:24 +02:00 committed by GitHub
parent 01d8d70b10
commit 0fd1fb9329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@ use std::any::type_name;
use std::any::Any;
use std::any::TypeId;
use std::borrow::Cow;
use std::collections::HashMap;
use std::collections::BTreeMap;
use std::iter::Iterator;
use std::rc::Rc;
@ -67,7 +67,7 @@ pub type ResourceId = u32;
/// the key in the map.
#[derive(Default)]
pub struct ResourceTable {
index: HashMap<ResourceId, Rc<dyn Resource>>,
index: BTreeMap<ResourceId, Rc<dyn Resource>>,
next_rid: ResourceId,
}