Skip to content

Commit

Permalink
micro fix by adding std:: before int8_t type. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
serges147 authored Jul 1, 2024
1 parent 2d7595d commit 92a3d9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions c++/cavl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ auto Node<Derived>::adjustBalance(const bool increment) noexcept -> Node*
const auto new_bf = static_cast<std::int8_t>(bf + (increment ? +1 : -1));
if ((new_bf < -1) || (new_bf > 1))
{
const bool r = new_bf < 0; // bf<0 if left-heavy --> right rotation is needed.
const int8_t sign = r ? +1 : -1; // Positive if we are rotating right.
Node* const z = lr[!r];
const bool r = new_bf < 0; // bf<0 if left-heavy --> right rotation is needed.
const std::int8_t sign = r ? +1 : -1; // Positive if we are rotating right.
Node* const z = lr[!r];
CAVL_ASSERT(z != nullptr); // Heavy side cannot be empty. NOLINTNEXTLINE(clang-analyzer-core.NullDereference)
if ((z->bf * sign) <= 0) // Parent and child are heavy on the same side or the child is balanced.
{
Expand Down

0 comments on commit 92a3d9e

Please sign in to comment.