Skip to content

Commit

Permalink
chore: hand refers to tail if removed node is head
Browse files Browse the repository at this point in the history
  • Loading branch information
kubo39 committed May 19, 2024
1 parent 418d899 commit c07c203
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/sievecache/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct SieveCache(K, V) if (isEqualityComparable!K && isKeyableType!K)
Node!(K, V)* node = *nodePtr;
if (node is hand_)
{
hand_ = node.prev;
hand_ = node.prev !is null ? node.prev : tail_;
}
removeNode(node);
assert(length_ > 0);
Expand All @@ -215,7 +215,7 @@ struct SieveCache(K, V) if (isEqualityComparable!K && isKeyableType!K)
auto node = *nodePtr;
if (node is hand_)
{
hand_ = node.prev;
hand_ = node.prev !is null ? node.prev : tail_;
}
removeNode(node);
assert(length_ > 0);
Expand Down

0 comments on commit c07c203

Please sign in to comment.