From d83739a9801a59301fd2759f06787bfb841c9de1 Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Mon, 20 Feb 2023 19:40:19 +0100 Subject: [PATCH] Clarify the intention of strange condition It may not be obvious why the condition in `push_bytes` module checks for negation of 16 and 32 bit architectures rather than 64 bit. This adds a comment about it being conservative. --- bitcoin/src/blockdata/script/push_bytes.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitcoin/src/blockdata/script/push_bytes.rs b/bitcoin/src/blockdata/script/push_bytes.rs index 55b4dbc7..3f143630 100644 --- a/bitcoin/src/blockdata/script/push_bytes.rs +++ b/bitcoin/src/blockdata/script/push_bytes.rs @@ -435,6 +435,8 @@ mod error { } } +// we have 64 bits in mind, but even for esoteric sizes, this code is correct, since it's the +// conservative one that checks for errors #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] mod error { use core::fmt;