Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge committed May 30, 2018
1 parent e009eb2 commit afc4c8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ To run the benchmarks on Linux with GPU optimizations enabled:

```bash
$ wget https://solana-build-artifacts.s3.amazonaws.com/v0.5.0/libcuda_verify_ed25519.a
$ cargo +nightly bench --features="unstable,cuda"
$ cargo +nightly bench --features="unstable,cuda,erasure"
```

Code coverage
Expand Down
19 changes: 7 additions & 12 deletions src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,13 @@ impl Crdt {
};

// enumerate all the blobs, those are the indices
let orders: Vec<_> = blobs.iter().enumerate().collect();
info!("orders table {}", orders.len());
let _: Vec<_> = orders
.into_iter()
.map(|(i, b)| {
// only leader should be broadcasting
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();
for (i, b) in blobs.iter().enumerate() {
// only leader should be broadcasting
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");
}
info!("set blobs index");

Ok(())
Expand Down
5 changes: 2 additions & 3 deletions src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,8 @@ fn broadcast(
// Fill in the coding blob data from the window data blobs
#[cfg(feature = "erasure")]
{
match erasure::generate_coding(&mut window.write().unwrap(), *transmit_index as usize) {
Err(_e) => return Err(Error::GenericError),
_ => {}
if erasure::generate_coding(&mut window.write().unwrap(), *transmit_index as usize).is_err() {
return Err(Error::GenericError);
}
}

Expand Down

0 comments on commit afc4c8f

Please sign in to comment.