From aefa941626514dd27c378fee41bd8231f57ab5d3 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 28 Jun 2016 16:38:14 +0200 Subject: [PATCH] Pass a straight Vec to DisplayList::new(). There is no reason to have a runtime check here. --- components/gfx/display_list/mod.rs | 7 +------ components/layout_thread/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index ac93adcca1f..1c2c7cca579 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -215,13 +215,8 @@ pub struct DisplayList { impl DisplayList { pub fn new(mut root_stacking_context: StackingContext, - items: &mut Option>) + items: Vec) -> 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); diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index e47670f99c1..ff42af63ee5 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -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 {