Skip to content

Commit 16aa916

Browse files
committed
Merge rust-bitcoin#5015: remove redundant variable in compact_size encoding
11e87e0 remove redundant variable in compact_size encoding (sent deed) Pull request description: Remove unnecessary intermediate variable `v` in the 9-byte encoding branch of `compact_size::encode()`. The variable was assigned `value` and used immediately, adding no functional value ACKs for top commit: apoelstra: ACK 11e87e0; successfully ran local tests; yeah ok Tree-SHA512: 857ec81aa0e9911a581b9245a2e39595450c164e319e74fa517278a976ad40574a660fa6ca4ad3b2c28423e99f4aa88d05e7e5df7776eeffaaec040231ec3fdc
2 parents 3204622 + 11e87e0 commit 16aa916

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internals/src/compact_size.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ pub fn encode(value: impl ToU64) -> ArrayVec<u8, MAX_ENCODING_SIZE> {
6969
res.extend_from_slice(&v.to_le_bytes());
7070
}
7171
_ => {
72-
let v = value;
7372
res.push(0xFF);
74-
res.extend_from_slice(&v.to_le_bytes());
73+
res.extend_from_slice(&value.to_le_bytes());
7574
}
7675
}
7776
res

0 commit comments

Comments
 (0)