Fix items-after-statements

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-02 00:22:48 +00:00 committed by June 🍓🦴
parent 2ab427fe99
commit 68cbf19154
6 changed files with 14 additions and 13 deletions

View file

@ -23,13 +23,13 @@ impl KvTree for RocksDbEngineTree<'_> {
}
fn multi_get(&self, keys: &[&[u8]]) -> Result<Vec<Option<Vec<u8>>>> {
let mut readoptions = rust_rocksdb::ReadOptions::default();
readoptions.set_total_order_seek(true);
// Optimization can be `true` if key vector is pre-sorted **by the column
// comparator**.
const SORTED: bool = false;
let mut readoptions = rust_rocksdb::ReadOptions::default();
readoptions.set_total_order_seek(true);
let mut ret: Vec<Option<Vec<u8>>> = Vec::with_capacity(keys.len());
for res in self
.db

View file

@ -261,8 +261,9 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
impl Drop for Engine {
fn drop(&mut self) {
debug!("Waiting for background tasks to finish...");
const BLOCKING: bool = true;
debug!("Waiting for background tasks to finish...");
self.rocks.cancel_all_background_work(BLOCKING);
debug!("Shutting down background threads");

View file

@ -17,13 +17,14 @@ use super::{
/// columns, therefor columns should only be opened after passing this result
/// through cf_options().
pub(crate) fn db_options(config: &Config, env: &mut Env, row_cache: &Cache, col_cache: &Cache) -> Options {
const MIN_PARALLELISM: usize = 2;
let mut opts = Options::default();
// Logging
set_logging_defaults(&mut opts, config);
// Processing
const MIN_PARALLELISM: usize = 2;
let threads = if config.rocksdb_parallelism_threads == 0 {
cmp::max(MIN_PARALLELISM, utils::available_parallelism())
} else {