pub fn merge<H: Hasher + Default>(
    height: u8,
    node_key: &H256,
    lhs: &MergeValue,
    rhs: &MergeValue,
) -> MergeValue {
    if lhs.is_zero() && rhs.is_zero() {
        return MergeValue::zero();
    }
    if lhs.is_zero() {
        return merge_with_zero::<H>(height, node_key, rhs, true);
    }
    if rhs.is_zero() {
        return merge_with_zero::<H>(height, node_key, lhs, false);
    }
    let mut hasher = H::default();
    hasher.write_byte(MERGE_NORMAL);
    hasher.write_byte(height);
    hasher.write_h256(node_key);
    hasher.write_h256(&lhs.hash::<H>());
    hasher.write_h256(&rhs.hash::<H>());
    MergeValue::Value(hasher.finish())
}
/// Merge two hash with node information
/// this function optimized for ZERO_HASH
/// if lhs and rhs both are ZERO_HASH return ZERO_HASH, otherwise hash all info.
Merge two hash with node information
this function optimized for ZERO_HASH
if lhs and rhs both are ZERO_HASH return ZERO_HASH, otherwise hash all info.
Merge two hash with node information this function optimized for ZERO_HASH if lhs and rhs both are ZERO_HASH return ZERO_HASH otherwise hash all info .
pub fn merge<H: Hasher + Default>(
    height: u8,
    node_key: &H256,
    lhs: &MergeValue,
    rhs: &MergeValue,
) -> MergeValue {
    if lhs.is_zero() && rhs.is_zero() {
        return MergeValue::zero();
    }
    if lhs.is_zero() {
        return merge_with_zero::<H>(height, node_key, rhs, true);
    }
    if rhs.is_zero() {
        return merge_with_zero::<H>(height, node_key, lhs, false);
    }
    let mut hasher = H::default();
    hasher.write_byte(MERGE_NORMAL);
    hasher.write_byte(height);
    hasher.write_h256(node_key);
    hasher.write_h256(&lhs.hash::<H>());
    hasher.write_h256(&rhs.hash::<H>());
    MergeValue::Value(hasher.finish())
}
pub fn merge < H : Hasher + Default > ( height : u8 , node_key : & H256 , lhs : & MergeValue , rhs : & MergeValue , ) -> MergeValue { if lhs . is_zero ( ) && rhs . is_zero ( ) { return MergeValue :: zero ( ) ; } if lhs . is_zero ( ) { return merge_with_zero :: < H > ( height , node_key , rhs , true ) ; } if rhs . is_zero ( ) { return merge_with_zero :: < H > ( height , node_key , lhs , false ) ; } let mut hasher = H :: default ( ) ; hasher . write_byte ( MERGE_NORMAL ) ; hasher . write_byte ( height ) ; hasher . write_h256 ( node_key ) ; hasher . write_h256 ( & lhs . hash :: < H > ( ) ) ; hasher . write_h256 ( & rhs . hash :: < H > ( ) ) ; MergeValue :: Value ( hasher . finish ( ) ) }
Merge two hash with node information
this function optimized for ZERO_HASH
if lhs and rhs both are ZERO_HASH return ZERO_HASH, otherwise hash all info.
Merge two hash with node information this function optimized for ZERO_HASH if lhs and rhs both are ZERO_HASH return ZERO_HASH otherwise hash all info .
height
u8
node_key
&H256
lhs
&MergeValue
rhs
&MergeValue
height
u8
node_key
&H256
lhs
&MergeValue
rhs
&MergeValue