rustfmt
This commit is contained in:
parent
f0f70f801e
commit
e769406b92
@ -81,7 +81,7 @@ impl<'a, D> ChainFilter<'a, D> where D: FilterDataSource
|
||||
for i in 0..self.index_size {
|
||||
indexes.insert(BloomIndex {
|
||||
level: new_level,
|
||||
index: offset + i
|
||||
index: offset + i,
|
||||
});
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ impl<'a, D> Filter for ChainFilter<'a, D> where D: FilterDataSource
|
||||
let bloom_index = self.bloom_index(block_number, level);
|
||||
let new_bloom = match self.data_source.bloom_at_index(&bloom_index) {
|
||||
Some(old_bloom) => old_bloom | bloom,
|
||||
None => bloom.clone()
|
||||
None => bloom.clone(),
|
||||
};
|
||||
|
||||
result.insert(bloom_index, new_bloom);
|
||||
@ -125,15 +125,15 @@ impl<'a, D> Filter for ChainFilter<'a, D> where D: FilterDataSource
|
||||
Some(to_shift) => {
|
||||
*to_shift = &blooms[i] | to_shift;
|
||||
false
|
||||
},
|
||||
None => true
|
||||
}
|
||||
None => true,
|
||||
};
|
||||
|
||||
// it hasn't been modified yet
|
||||
if is_new_bloom {
|
||||
let new_bloom = match self.data_source.bloom_at_index(&bloom_index) {
|
||||
Some(old_bloom) => old_bloom | &blooms[i],
|
||||
None => blooms[i].clone()
|
||||
None => blooms[i].clone(),
|
||||
};
|
||||
result.insert(bloom_index, new_bloom);
|
||||
}
|
||||
@ -157,7 +157,7 @@ impl<'a, D> Filter for ChainFilter<'a, D> where D: FilterDataSource
|
||||
.filter(|li| li != &reset_index)
|
||||
.map(|li| self.data_source.bloom_at_index(&li))
|
||||
.filter_map(|b| b)
|
||||
.fold(H2048::new(), | acc, bloom | { &acc | bloom });
|
||||
.fold(H2048::new(), |acc, bloom| &acc | bloom);
|
||||
|
||||
reset_index = index.clone();
|
||||
result.insert(index, &new_bloom | bloom);
|
||||
@ -172,7 +172,11 @@ impl<'a, D> Filter for ChainFilter<'a, D> where D: FilterDataSource
|
||||
}
|
||||
|
||||
/// returns numbers of blocks that may contain Address
|
||||
fn blocks_with_address(&self, address: &Address, from_block: usize ,to_block: usize) -> Vec<usize> {
|
||||
fn blocks_with_address(&self,
|
||||
address: &Address,
|
||||
from_block: usize,
|
||||
to_block: usize)
|
||||
-> Vec<usize> {
|
||||
let mut bloom = H2048::new();
|
||||
bloom.shift_bloom(&address.sha3());
|
||||
self.blocks_with_bloom(&bloom, from_block, to_block)
|
||||
|
Loading…
Reference in New Issue
Block a user