From 964a7af32f709b311ac549808ae331827bdcb480 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 18 Apr 2018 14:23:12 +0200 Subject: [PATCH] Fix list assertions for release build --- source/tanya/container/list.d | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/tanya/container/list.d b/source/tanya/container/list.d index b271888..81ce4d1 100644 --- a/source/tanya/container/list.d +++ b/source/tanya/container/list.d @@ -435,9 +435,9 @@ struct SList(T) assert(l2.front == 9); } - version (assert) + private bool checkRangeBelonging(ref const Range r) const { - private bool checkRangeBelonging(ref const Range r) const + version (assert) { const(Entry)* pos = this.head; for (; pos !is *r.head && pos !is null; pos = pos.next) @@ -445,6 +445,10 @@ struct SList(T) } return pos is *r.head; } + else + { + return true; + } } /** @@ -1602,9 +1606,9 @@ struct DList(T) /// ditto alias insert = insertBack; - version (assert) + private bool checkRangeBelonging(ref const Range r) const { - private bool checkRangeBelonging(ref const Range r) const + version (assert) { const(Entry)* pos = this.head; for (; pos !is *r.head && pos !is null; pos = pos.next) @@ -1612,6 +1616,10 @@ struct DList(T) } return pos is *r.head; } + else + { + return true; + } } /**