summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/data_type.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-05-02 17:55:57 +0000
committerDavid Robillard <d@drobilla.net>2007-05-02 17:55:57 +0000
commit5a1ca70f07aeb999ba3f0f09dbd49f1d50505f3c (patch)
tree5922cf4ffa536fd31c0d9e85bcf3a3443437927f /libs/ardour/ardour/data_type.h
parentc3e666867cfd44768c9aa605abefde78274ace24 (diff)
Fixed performance (assert/branching/call overhead) issue with DataType.
git-svn-id: svn://localhost/ardour2/branches/midi@1776 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/data_type.h')
-rw-r--r--libs/ardour/ardour/data_type.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/libs/ardour/ardour/data_type.h b/libs/ardour/ardour/data_type.h
index 2703372311..3e461139b5 100644
--- a/libs/ardour/ardour/data_type.h
+++ b/libs/ardour/ardour/data_type.h
@@ -48,15 +48,6 @@ public:
*/
static const size_t num_types = 2;
-
- /** Helper for collections that store typed things by index (BufferSet, PortList).
- * Guaranteed to be a valid index from 0 to (the number of available types - 1),
- * because NIL is not included. No, this isn't pretty - purely for speed.
- * See DataType::to_index().
- */
- inline static size_t symbol_index(const Symbol symbol)
- { return (size_t)symbol - 1; }
-
DataType(const Symbol& symbol)
: _symbol(symbol)
{}
@@ -95,8 +86,8 @@ public:
}
}
- Symbol to_symbol() const { return _symbol; }
- inline size_t to_index() const { assert(_symbol != NIL); return symbol_index(_symbol); }
+ //Symbol to_symbol() const { return _symbol; }
+ inline size_t to_index() const { return (size_t)_symbol - 1; }
/** DataType iterator, for writing generic loops that iterate over all
* available types.