mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29: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
|
@ -55,6 +55,7 @@ use embedder_traits::{
|
|||
};
|
||||
use euclid::Point2D;
|
||||
use euclid::default::Rect;
|
||||
use fnv::FnvHashMap;
|
||||
use fonts::{FontContext, SystemFontServiceProxy};
|
||||
use headers::{HeaderMapExt, LastModified, ReferrerPolicy as ReferrerPolicyHeader};
|
||||
use http::header::REFRESH;
|
||||
|
@ -1943,7 +1944,7 @@ impl ScriptThread {
|
|||
fn handle_set_scroll_states(
|
||||
&self,
|
||||
pipeline_id: PipelineId,
|
||||
scroll_states: HashMap<ExternalScrollId, LayoutVector2D>,
|
||||
scroll_states: FnvHashMap<ExternalScrollId, LayoutVector2D>,
|
||||
) {
|
||||
let Some(window) = self.documents.borrow().find_window(pipeline_id) else {
|
||||
warn!("Received scroll states for closed pipeline {pipeline_id}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue