Skip to content

Commit

Permalink
Use static empty vector in script, comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Aug 14, 2024
1 parent 4f9e43c commit 482bd95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/bitcoin/system/impl/machine/number.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ inline data_chunk chunk::from_bool(bool vary) NOEXCEPT

inline data_chunk chunk::from_integer(int64_t vary) NOEXCEPT
{
static const data_chunk empty{};

// absolute(minimum<int64_t>) guarded by the presumption of int32 ops.
BC_ASSERT(!is_negate_overflow(vary));

// Just an optimization.
if (is_zero(vary))
return {};
return empty;

const auto value = absolute(vary);
const auto negated = is_negated(value);
Expand All @@ -148,7 +150,6 @@ inline data_chunk chunk::from_integer(int64_t vary) NOEXCEPT

// boolean
// ----------------------------------------------------------------------------
// C++20: constexpr.

template <size_t Size,
if_not_greater<Size, sizeof(int64_t)>>
Expand Down

0 comments on commit 482bd95

Please sign in to comment.