Pass a straight Vec to DisplayList::new().

There is no reason to have a runtime check here.
This commit is contained in:
Ms2ger 2016-06-28 16:38:14 +02:00
parent 62f7e8fe4b
commit aefa941626
2 changed files with 2 additions and 8 deletions

View file

@ -215,13 +215,8 @@ pub struct DisplayList {
impl DisplayList {
pub fn new(mut root_stacking_context: StackingContext,
items: &mut Option<Vec<DisplayItem>>)
items: Vec<DisplayItem>)
-> DisplayList {
let items = match items.take() {
Some(items) => items,
None => panic!("Tried to create empty display list."),
};
let mut offsets = FnvHashMap(HashMap::with_hasher(Default::default()));
DisplayList::sort_and_count_stacking_contexts(&mut root_stacking_context, &mut offsets, 0);

View file

@ -918,8 +918,7 @@ impl LayoutThread {
root_background_color));
rw_data.display_list =
Some(Arc::new(DisplayList::new(root_stacking_context,
&mut Some(display_list_entries))))
Some(Arc::new(DisplayList::new(root_stacking_context, display_list_entries)))
}
if data.goal == ReflowGoal::ForDisplay {