mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(reth-etl): use constant (#10614)
This commit is contained in:
@ -21,6 +21,9 @@ use std::{
|
|||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Key len and Value len encode use [`usize::to_be_bytes()`] the length is 8.
|
||||||
|
const KV_LEN: usize = 8;
|
||||||
|
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use reth_db_api::table::{Compress, Encode, Key, Value};
|
use reth_db_api::table::{Compress, Encode, Key, Value};
|
||||||
use tempfile::{NamedTempFile, TempDir};
|
use tempfile::{NamedTempFile, TempDir};
|
||||||
@ -256,8 +259,8 @@ impl EtlFile {
|
|||||||
return Ok(None)
|
return Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut buffer_key_length = [0; 8];
|
let mut buffer_key_length = [0; KV_LEN];
|
||||||
let mut buffer_value_length = [0; 8];
|
let mut buffer_value_length = [0; KV_LEN];
|
||||||
|
|
||||||
self.file.read_exact(&mut buffer_key_length)?;
|
self.file.read_exact(&mut buffer_key_length)?;
|
||||||
self.file.read_exact(&mut buffer_value_length)?;
|
self.file.read_exact(&mut buffer_value_length)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user