From 6660b3d65feaff95c886ec09ffed5791e8a88e4b Mon Sep 17 00:00:00 2001 From: debris Date: Mon, 30 Nov 2015 16:14:03 +0100 Subject: [PATCH] replaced usages of append(&"") to append_empty_data() --- src/triehash.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/triehash.rs b/src/triehash.rs index bc8dedf76..e26cc255f 100644 --- a/src/triehash.rs +++ b/src/triehash.rs @@ -138,9 +138,9 @@ fn as_nibbles(bytes: &[u8]) -> Vec { fn hash256rlp(input: &[(Vec, Vec)], pre_len: usize, stream: &mut RlpStream) { let inlen = input.len(); - // in case of empty slice, just append null + // in case of empty slice, just append empty data if inlen == 0 { - stream.append(&""); + stream.append_empty_data(); return; } @@ -196,7 +196,7 @@ fn hash256rlp(input: &[(Vec, Vec)], pre_len: usize, stream: &mut RlpStre // if at least 1 successive element has the same nibble // append their suffixes match len { - 0 => { stream.append(&""); }, + 0 => { stream.append_empty_data(); }, _ => hash256aux(&input[begin..(begin + len)], pre_len + 1, stream) } begin += len; @@ -205,7 +205,7 @@ fn hash256rlp(input: &[(Vec, Vec)], pre_len: usize, stream: &mut RlpStre // if fist key len is equal prefix, append it's value match pre_len == key.len() { true => { stream.append(&value); }, - false => { stream.append(&""); } + false => { stream.append_empty_data(); } }; }