Switch Arc<Box<Image>> to Arc<Image> for perf boost.

Image used to be a trait, but no longer is, so boxing it is no longer
necessary.
This commit is contained in:
Aneesh Agrawal 2015-04-10 18:59:02 -04:00
parent a8b0fb1e79
commit 5b593a3d32
7 changed files with 13 additions and 13 deletions

View file

@ -110,7 +110,7 @@ enum ImageState {
Prefetching(AfterPrefetch),
Prefetched(Vec<u8>),
Decoding,
Decoded(Arc<Box<Image>>),
Decoded(Arc<Image>),
Failed
}
@ -303,7 +303,7 @@ impl ImageCache {
load_from_memory(&data)
});
let image = image.map(|image| Arc::new(box image));
let image = image.map(|image| Arc::new(image));
to_cache.send(Msg::StoreImage(url.clone(), image)).unwrap();
debug!("image_cache_task: ended image decode for {}", url.serialize());
});
@ -317,7 +317,7 @@ impl ImageCache {
}
}
fn store_image(&mut self, url: Url, image: Option<Arc<Box<Image>>>) {
fn store_image(&mut self, url: Url, image: Option<Arc<Image>>) {
match self.get_state(&url) {
ImageState::Decoding => {