Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
serges147 committed Aug 8, 2024
1 parent 3070d61 commit 1094908
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 @@ -214,7 +214,7 @@ class Node // NOSONAR cpp:S1448 cpp:S4963
private:
void moveFrom(Node& other) noexcept
{
CAVL_ASSERT(nullptr == up); // Should not be part of any tree yet.
CAVL_ASSERT(!isLinked()); // Should not be part of any tree yet.

up = other.up;
lr[0] = other.lr[0];
Expand Down Expand Up @@ -338,7 +338,7 @@ auto Node<Derived>::search(Node& origin, const Pre& predicate, const Fac& factor
bool r = false;
while (n != nullptr)
{
CAVL_ASSERT(nullptr != n->up);
CAVL_ASSERT(n->isLinked());

const auto cmp = predicate(*down(n));
if (0 == cmp)
Expand Down Expand Up @@ -486,7 +486,7 @@ void Node<Derived>::remove(Node& origin, const Node* const node) noexcept // NO
template <typename Derived>
auto Node<Derived>::adjustBalance(const bool increment) noexcept -> Node*
{
CAVL_ASSERT(nullptr != up);
CAVL_ASSERT(isLinked());
CAVL_ASSERT(((bf >= -1) && (bf <= +1)));
Node* out = this;
const auto new_bf = static_cast<std::int8_t>(bf + (increment ? +1 : -1));
Expand Down

0 comments on commit 1094908

Please sign in to comment.