mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Only allocate a HashMap
if we need to.
This commit is contained in:
parent
22928f50ac
commit
d9c9d4ab36
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref PREFS: Preferences = {
|
pub static ref PREFS: Preferences = {
|
||||||
let prefs = read_prefs().unwrap_or(HashMap::new());
|
let prefs = read_prefs().unwrap_or_else(|_| HashMap::new());
|
||||||
Preferences(Arc::new(Mutex::new(prefs)))
|
Preferences(Arc::new(Mutex::new(prefs)))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue