Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing recursion from ComplexSelector WIP #16227

Closed
wants to merge 6 commits into from

Remove useless ImageDecoderRunnable struct

  • Loading branch information
ferjm authored and Matthew committed Apr 6, 2017
commit 05915e3589a19c522c58e8583195c4372a850f73
@@ -401,25 +401,6 @@ impl ImageCacheStore {
}
}

struct ImageDecoderRunnable {
store: Arc<Mutex<ImageCacheStore>>,
key: PendingImageId,
bytes: Arc<Vec<u8>>,
}

impl ImageDecoderRunnable {
fn run(&self) {
let local_store = self.store.clone();
let bytes = self.bytes.clone();
let key = self.key.clone();
thread::spawn(move || {
let msg = decode_bytes_sync(key, &*bytes);
debug!("Image decoded");
local_store.lock().unwrap().handle_decoder(msg);
});
}
}

pub struct ImageCacheImpl {
store: Arc<Mutex<ImageCacheStore>>,
}
@@ -545,12 +526,12 @@ impl ImageCache for ImageCacheImpl {
pending_load.bytes.mark_complete()
};

let image_decoder_runnable = ImageDecoderRunnable {
store: self.store.clone(),
key: key,
bytes: bytes.clone(),
};
image_decoder_runnable.run();
let local_store = self.store.clone();
thread::spawn(move || {
let msg = decode_bytes_sync(key, &*bytes);
debug!("Image decoded");
local_store.lock().unwrap().handle_decoder(msg);
});
}
Err(_) => {
debug!("Processing error for {:?}", key);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.