Skip to content

Commit

Permalink
Simplify a little bit and get rid of every performance opt
Browse files Browse the repository at this point in the history
  • Loading branch information
umgefahren committed Mar 7, 2024
1 parent 0b6dbb1 commit d2fddd5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions protocols/autonat/src/v2/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ impl From<DialDataResponse> for proto::Message {
val.data_count <= DATA_FIELD_LEN_UPPER_BOUND,
"data_count too large"
);
static DATA: &[u8] = &[0u8; DATA_FIELD_LEN_UPPER_BOUND];
proto::Message {
msg: proto::mod_Message::OneOfmsg::dialDataResponse(proto::DialDataResponse {
data: Some(DATA[..val.data_count].to_vec()), // Once could use Cow::Borrowed here, but it will require a modification of the generated code and that will fail the CI
data: Some(vec![0; val.data_count]), // One could use Cow::Borrowed here, but it will require a modification of the generated code and that will fail the CI
}),
}
}
Expand Down

0 comments on commit d2fddd5

Please sign in to comment.