mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-08 12:21:09 +03:00
Cleanup unused fn on rm_log (#999)
This commit is contained in:
parent
ef304ee9c1
commit
46a7245ec1
2 changed files with 0 additions and 19 deletions
|
@ -26,7 +26,6 @@ use core::core::{Block, BlockHeader};
|
||||||
use core::consensus::TargetError;
|
use core::consensus::TargetError;
|
||||||
use core::core::target::Difficulty;
|
use core::core::target::Difficulty;
|
||||||
use grin_store::{self, option_to_not_found, to_key, Error, u64_to_key};
|
use grin_store::{self, option_to_not_found, to_key, Error, u64_to_key};
|
||||||
use util::LOGGER;
|
|
||||||
|
|
||||||
const STORE_SUBPATH: &'static str = "chain";
|
const STORE_SUBPATH: &'static str = "chain";
|
||||||
|
|
||||||
|
|
|
@ -328,24 +328,6 @@ impl RemoveLog {
|
||||||
include_tuple(&self.removed, elmt) || include_tuple(&self.removed_tmp, elmt)
|
include_tuple(&self.removed, elmt) || include_tuple(&self.removed_tmp, elmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How many removed positions exist before this particular position
|
|
||||||
pub fn get_shift(&self, elmt: u64) -> usize {
|
|
||||||
let mut complete_list = self.removed.clone();
|
|
||||||
for e in &self.removed_tmp {
|
|
||||||
match self.removed.binary_search(&e) {
|
|
||||||
Ok(_) => continue,
|
|
||||||
Err(idx) => {
|
|
||||||
complete_list.insert(idx, *e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let pos = match complete_list.binary_search(&(elmt, 0)) {
|
|
||||||
Ok(idx) => idx + 1,
|
|
||||||
Err(idx) => idx,
|
|
||||||
};
|
|
||||||
complete_list.split_at(pos).0.len()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Number of positions stored in the remove log.
|
/// Number of positions stored in the remove log.
|
||||||
pub fn len(&self) -> usize {
|
pub fn len(&self) -> usize {
|
||||||
self.removed.len()
|
self.removed.len()
|
||||||
|
|
Loading…
Reference in a new issue