From 09bede3b805d88c41c0e39a236c34f6ee9c4572c Mon Sep 17 00:00:00 2001 From: Robert Schadek Date: Mon, 27 Jan 2020 09:23:07 +0000 Subject: [PATCH] adding assert messages to rbtree --- std/container/rbtree.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/std/container/rbtree.d b/std/container/rbtree.d index 41b3c2ad3..6540f93d9 100644 --- a/std/container/rbtree.d +++ b/std/container/rbtree.d @@ -183,7 +183,7 @@ struct RBNode(V) Node rotateR() in { - assert(_left !is null); + assert(_left !is null, "left node must not be null"); } do { @@ -226,7 +226,7 @@ struct RBNode(V) Node rotateL() in { - assert(_right !is null); + assert(_right !is null, "right node must not be null"); } do { @@ -255,7 +255,7 @@ struct RBNode(V) @property bool isLeftNode() const in { - assert(_parent !is null); + assert(_parent !is null, "parent must not be null"); } do { @@ -789,7 +789,8 @@ if (is(typeof(binaryFun!less(T.init, T.init)))) private void _setup() { - assert(!_end); //Make sure that _setup isn't run more than once. + //Make sure that _setup isn't run more than once. + assert(!_end, "Setup must only be run once"); _begin = _end = allocate(); }