bpf_loader: fix clippy::blocks_in_conditions lint (#34643)
See https://github.com/solana-labs/solana/issues/34626
This commit is contained in:
parent
0b49d82d3e
commit
917e242e7f
|
@ -216,15 +216,7 @@ fn memcmp_non_contiguous(
|
|||
n: u64,
|
||||
memory_mapping: &MemoryMapping,
|
||||
) -> Result<i32, Error> {
|
||||
match iter_memory_pair_chunks(
|
||||
AccessType::Load,
|
||||
src_addr,
|
||||
AccessType::Load,
|
||||
dst_addr,
|
||||
n,
|
||||
memory_mapping,
|
||||
false,
|
||||
|s1_addr, s2_addr, chunk_len| {
|
||||
let memcmp_chunk = |s1_addr, s2_addr, chunk_len| {
|
||||
let res = unsafe {
|
||||
let s1 = slice::from_raw_parts(s1_addr, chunk_len);
|
||||
let s2 = slice::from_raw_parts(s2_addr, chunk_len);
|
||||
|
@ -238,7 +230,16 @@ fn memcmp_non_contiguous(
|
|||
return Err(MemcmpError::Diff(res).into());
|
||||
}
|
||||
Ok(0)
|
||||
},
|
||||
};
|
||||
match iter_memory_pair_chunks(
|
||||
AccessType::Load,
|
||||
src_addr,
|
||||
AccessType::Load,
|
||||
dst_addr,
|
||||
n,
|
||||
memory_mapping,
|
||||
false,
|
||||
memcmp_chunk,
|
||||
) {
|
||||
Ok(res) => Ok(res),
|
||||
Err(error) => match error.downcast_ref() {
|
||||
|
|
Loading…
Reference in New Issue