Review comments

This commit is contained in:
Stephen Akridge
2018-05-29 18:50:36 -07:00
committed by Greg Fitzgerald
parent 6843b71a0d
commit 5455e8e6a9
2 changed files with 10 additions and 15 deletions

View File

@ -241,18 +241,13 @@ impl Crdt {
}; };
// enumerate all the blobs, those are the indices // enumerate all the blobs, those are the indices
let orders: Vec<_> = blobs.iter().enumerate().collect(); for (i, b) in blobs.iter().enumerate() {
info!("orders table {}", orders.len()); // only leader should be broadcasting
let _: Vec<_> = orders let mut blob = b.write().expect("'blob' write lock in crdt::index_blobs");
.into_iter() blob.set_id(me.id).expect("set_id in pub fn broadcast");
.map(|(i, b)| { blob.set_index(*transmit_index + i as u64)
// only leader should be broadcasting .expect("set_index in pub fn broadcast");
let mut blob = b.write().expect("'blob' write lock in crdt::index_blobs"); }
blob.set_id(me.id).expect("set_id in pub fn broadcast");
blob.set_index(*transmit_index + i as u64)
.expect("set_index in pub fn broadcast");
})
.collect();
info!("set blobs index"); info!("set blobs index");
Ok(()) Ok(())

View File

@ -414,9 +414,9 @@ fn broadcast(
// Fill in the coding blob data from the window data blobs // Fill in the coding blob data from the window data blobs
#[cfg(feature = "erasure")] #[cfg(feature = "erasure")]
{ {
match erasure::generate_coding(&mut window.write().unwrap(), *transmit_index as usize) { if erasure::generate_coding(&mut window.write().unwrap(), *transmit_index as usize).is_err()
Err(_e) => return Err(Error::GenericError), {
_ => {} return Err(Error::GenericError);
} }
} }