From e3899fa6e89b7839c920fbfbb20237963d7e538d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Jul 2007 00:26:40 +0000 Subject: Use uint32_t for num_ports (and poly), matches LV2 and size_t is excessive on 64-bit. Remove (linear) sorted assertion from Table, except in unit tests. git-svn-id: http://svn.drobilla.net/lad/raul@643 a436a847-0d15-0410-975c-d299462d15a1 --- raul/Table.hpp | 4 +++- raul/TableImpl.hpp | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'raul') diff --git a/raul/Table.hpp b/raul/Table.hpp index 4ab449c..9fd672a 100644 --- a/raul/Table.hpp +++ b/raul/Table.hpp @@ -21,6 +21,8 @@ #include #include +//#define TABLE_SORT_DEBUG + namespace Raul { @@ -98,7 +100,7 @@ public: iterator end() { return iterator(*this, size()); } private: -#ifndef NDEBUG +#ifdef TABLE_SORT_DEBUG bool is_sorted() const; #endif diff --git a/raul/TableImpl.hpp b/raul/TableImpl.hpp index c1ed938..1bb4699 100644 --- a/raul/TableImpl.hpp +++ b/raul/TableImpl.hpp @@ -31,7 +31,7 @@ namespace Raul { * std::vector::iterator or vice-versa should be shot and pissed on. */ -#ifndef NDEBUG +#ifdef TABLE_SORT_DEBUG template bool Table::is_sorted() const @@ -231,7 +231,9 @@ Table::cram(const Table& range) std::cerr << "********************************\n";*/ assert(size() == orig_size + range.size()); +#ifdef TABLE_SORT_DEBUG assert(is_sorted()); +#endif return make_pair(iterator(*this, insert_index), true); } @@ -299,7 +301,9 @@ Table::insert(const std::pair& entry) _entries[i] = entry; +#ifdef TABLE_SORT_DEBUG assert(is_sorted()); +#endif return std::make_pair(iterator(*this, i), true); } @@ -350,7 +354,9 @@ Table::erase(iterator i) _entries.pop_back(); +#ifdef TABLE_SORT_DEBUG assert(is_sorted()); +#endif } @@ -383,7 +389,9 @@ Table::erase_by_index(size_t first_index, size_t last_index) _entries.resize(size() - num_removed); +#ifdef TABLE_SORT_DEBUG assert(is_sorted()); +#endif } -- cgit v1.2.1