mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
constellation: Use FnvHashMap
for hashmaps that use ids as keys (#39106)
FNV is faster for hashing less than 16 bytes of data and the cryptographic properties of the default HashMap are not needed for the various ids. Testing: This does not change functionality. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
0ae9ee28d5
commit
5c7ea4bdee
19 changed files with 71 additions and 54 deletions
|
@ -5,12 +5,13 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use base::id::WebViewId;
|
||||
use fnv::FnvHashMap;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WebViewManager<WebView> {
|
||||
/// Our top-level browsing contexts. In the WebRender scene, their pipelines are the children of
|
||||
/// a single root pipeline that also applies any pinch zoom transformation.
|
||||
webviews: HashMap<WebViewId, WebView>,
|
||||
webviews: FnvHashMap<WebViewId, WebView>,
|
||||
|
||||
/// The order in which they were focused, latest last.
|
||||
focus_order: Vec<WebViewId>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue