Skip to content

Commit

Permalink
chore(reth-etl): use constant (#10614)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg authored Aug 29, 2024
1 parent c228fe1 commit 83b116a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/etl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ use std::{
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 reth_db_api::table::{Compress, Encode, Key, Value};
use tempfile::{NamedTempFile, TempDir};
Expand Down Expand Up @@ -256,8 +259,8 @@ impl EtlFile {
return Ok(None)
}

let mut buffer_key_length = [0; 8];
let mut buffer_value_length = [0; 8];
let mut buffer_key_length = [0; KV_LEN];
let mut buffer_value_length = [0; KV_LEN];

self.file.read_exact(&mut buffer_key_length)?;
self.file.read_exact(&mut buffer_value_length)?;
Expand Down

0 comments on commit 83b116a

Please sign in to comment.