fix typos (#1644)
This commit is contained in:
committed by
Arkadiy Paronyan
parent
861c8d0701
commit
d67369a01c
@@ -201,7 +201,7 @@ impl<'a, 'view> View<'a, 'view> for UntrustedRlp<'a> where 'a: 'view {
|
||||
return Err(DecoderError::RlpExpectedToBeList);
|
||||
}
|
||||
|
||||
// move to cached position if it's index is less or equal to
|
||||
// move to cached position if its index is less or equal to
|
||||
// current search index, otherwise move to beginning of list
|
||||
let c = self.offset_cache.get();
|
||||
let (mut bytes, to_skip) = match c.index <= index {
|
||||
@@ -334,9 +334,9 @@ impl<'a> BasicDecoder<'a> {
|
||||
/// Return first item info.
|
||||
fn payload_info(bytes: &[u8]) -> Result<PayloadInfo, DecoderError> {
|
||||
let item = try!(PayloadInfo::from(bytes));
|
||||
match item.header_len.checked_add(item.value_len) {
|
||||
Some(x) if x <= bytes.len() => Ok(item),
|
||||
_ => Err(DecoderError::RlpIsTooShort),
|
||||
match item.header_len.checked_add(item.value_len) {
|
||||
Some(x) if x <= bytes.len() => Ok(item),
|
||||
_ => Err(DecoderError::RlpIsTooShort),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ impl<'db> TrieDB<'db> {
|
||||
ret
|
||||
}
|
||||
|
||||
/// Convert a vector of hashes to a hashmap of hash to occurances.
|
||||
/// Convert a vector of hashes to a hashmap of hash to occurrences.
|
||||
pub fn to_map(hashes: Vec<H256>) -> HashMap<H256, u32> {
|
||||
let mut r: HashMap<H256, u32> = HashMap::new();
|
||||
for h in hashes.into_iter() {
|
||||
@@ -93,7 +93,7 @@ impl<'db> TrieDB<'db> {
|
||||
r
|
||||
}
|
||||
|
||||
/// Determine occurances of items in the backing database which are not related to this
|
||||
/// Determine occurrences of items in the backing database which are not related to this
|
||||
/// trie.
|
||||
pub fn db_items_remaining(&self) -> HashMap<H256, i32> {
|
||||
let mut ret = self.db.keys();
|
||||
|
||||
@@ -255,7 +255,7 @@ fn hash256rlp(input: &[(Vec<u8>, Vec<u8>)], pre_len: usize, stream: &mut RlpStre
|
||||
begin += len;
|
||||
}
|
||||
|
||||
// if fist key len is equal prefix, append it's value
|
||||
// if fist key len is equal prefix, append its value
|
||||
match pre_len == key.len() {
|
||||
true => { stream.append(&value); },
|
||||
false => { stream.append_empty_data(); }
|
||||
|
||||
Reference in New Issue
Block a user