From b5a0731a23f945f7e4cc7d8f3c0f1d3f83875272 Mon Sep 17 00:00:00 2001 From: Chris Hyunhum Cho Date: Fri, 29 Nov 2024 08:06:51 +0000 Subject: [PATCH] refactor: remove unnecessary if block --- bitcoin/src/crypto/taproot.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bitcoin/src/crypto/taproot.rs b/bitcoin/src/crypto/taproot.rs index bfa857aa0..f050a9ec3 100644 --- a/bitcoin/src/crypto/taproot.rs +++ b/bitcoin/src/crypto/taproot.rs @@ -49,9 +49,8 @@ impl Signature { /// Note: this allocates on the heap, prefer [`serialize`](Self::serialize) if vec is not needed. pub fn to_vec(self) -> Vec { let mut ser_sig = self.signature.as_ref().to_vec(); - if self.sighash_type == TapSighashType::Default { - // default sighash type, don't add extra sighash byte - } else { + // If default sighash type, don't add extra sighash byte + if self.sighash_type != TapSighashType::Default { ser_sig.push(self.sighash_type as u8); } ser_sig