mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
style: Simplify the cascade function in the custom_properties module.
This commit is contained in:
parent
c44826f1cc
commit
369c2f299e
1 changed files with 36 additions and 34 deletions
|
@ -329,8 +329,11 @@ pub fn cascade<'a>(custom_properties: &mut Option<HashMap<&'a Name, BorrowedSpec
|
|||
seen: &mut HashSet<&'a Name>,
|
||||
name: &'a Name,
|
||||
specified_value: &'a DeclaredValue<SpecifiedValue>) {
|
||||
let was_not_already_present = seen.insert(name);
|
||||
if was_not_already_present {
|
||||
let was_already_present = !seen.insert(name);
|
||||
if was_already_present {
|
||||
return;
|
||||
}
|
||||
|
||||
let map = match *custom_properties {
|
||||
Some(ref mut map) => map,
|
||||
None => {
|
||||
|
@ -365,7 +368,6 @@ pub fn cascade<'a>(custom_properties: &mut Option<HashMap<&'a Name, BorrowedSpec
|
|||
DeclaredValue::Inherit => {} // The inherited value is what we already have.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the final map of applicable custom properties.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue