mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-18 11:28:05 +00:00
refactor: streaming core optimization and code deduplication
- Remove 'wide' and 'simd_utils.rs', rely on compiler auto-vectorization. - Deduplicate swap parsing in 'types.rs' and 'merger_event.rs' using generic traits and local macros. - Improve signature cleanup in 'global_state.rs' to avoid large heap allocations. - Replace manual metadata accessors in 'traits.rs' with a macro for all variants. - Remove unused types (ParseResult, ProtocolInfo) and legacy commented code. - Fix Clippy lints (is_empty, copied) and restore missing trait imports.
This commit is contained in:
@@ -58,14 +58,14 @@ pub fn read_u8_le(data: &[u8], offset: usize) -> Option<u8> {
|
||||
}
|
||||
|
||||
pub fn read_option_bool(data: &[u8], offset: &mut usize) -> Option<Option<bool>> {
|
||||
let has_value = data.get(*offset)?.clone();
|
||||
let has_value = data.get(*offset).copied()?;
|
||||
*offset += 1;
|
||||
|
||||
if has_value == 0 {
|
||||
return Some(None);
|
||||
}
|
||||
|
||||
let value = data.get(*offset)?.clone();
|
||||
let value = data.get(*offset).copied()?;
|
||||
*offset += 1;
|
||||
|
||||
Some(Some(value != 0))
|
||||
|
||||
Reference in New Issue
Block a user