From 0c9906bdfada7228c493d5d59a2d08206430fb55 Mon Sep 17 00:00:00 2001 From: Sam Yates <yates@cscs.ch> Date: Fri, 6 Jul 2018 17:59:53 +0200 Subject: [PATCH] Remove NDEBUG tests in memory utils. (#523) Fixes #182. --- arbor/memory/array_view.hpp | 18 ------------------ arbor/memory/copy.hpp | 2 -- 2 files changed, 20 deletions(-) diff --git a/arbor/memory/array_view.hpp b/arbor/memory/array_view.hpp index f63ccb29..cbdf1f5c 100644 --- a/arbor/memory/array_view.hpp +++ b/arbor/memory/array_view.hpp @@ -180,31 +180,23 @@ public: /// access half open sub-range using two indexes [left, right) view_type operator()(size_type left, size_type right) { - #ifndef NDEBUG arb_assert(right<=size_ && left<=right); - #endif return view_type(pointer_+left, right-left); } const_view_type operator()(size_type left, size_type right) const { - #ifndef NDEBUG arb_assert(right<=size_ && left<=right); - #endif return view_type(pointer_+left, right-left); } /// access half open sub-range using one index and one-past-the-end [left, end) view_type operator()(size_type left, end_type) { - #ifndef NDEBUG arb_assert(left<=size_); - #endif return view_type(pointer_+left, size_-left); } const_view_type operator()(size_type left, end_type) const { - #ifndef NDEBUG arb_assert(left<=size_); - #endif return view_type(pointer_+left, size_-left); } @@ -260,16 +252,12 @@ public: // per element accessors // return a reference type provided by Coordinator reference operator[] (size_type i) { - #ifndef NDEBUG arb_assert(i<size_); - #endif return coordinator_.make_reference(pointer_+i); } const_reference operator[] (size_type i) const { - #ifndef NDEBUG arb_assert(i<size_); - #endif return coordinator_.make_reference(pointer_+i); } @@ -385,17 +373,13 @@ public: /// access half open sub-range using two indexes [left, right) const_view_type operator()(size_type left, size_type right) const { -#ifndef NDEBUG arb_assert(right<=size_ && left<=right); -#endif return const_view_type(pointer_+left, right-left); } /// access half open sub-range using one index and one-past-the-end [left, end) const_view_type operator()(size_type left, end_type) const { -#ifndef NDEBUG arb_assert(left<=size_); -#endif return const_view_type(pointer_+left, size_-left); } @@ -439,9 +423,7 @@ public: // per element accessors // return a reference type provided by Coordinator const_reference operator[] (size_type i) const { - #ifndef NDEBUG arb_assert(i<size_); - #endif return coordinator_.make_reference(pointer_+i); } diff --git a/arbor/memory/copy.hpp b/arbor/memory/copy.hpp index 87f7495b..bf30835b 100644 --- a/arbor/memory/copy.hpp +++ b/arbor/memory/copy.hpp @@ -11,9 +11,7 @@ namespace memory { template <typename LHS, typename RHS> void copy(LHS&& from, RHS&& to) { -#ifndef NDEBUG arb_assert(from.size() == to.size()); -#endif #ifdef VERBOSE std::cerr << util::blue("copy") << " " -- GitLab