diff options
author | David Robillard <d@drobilla.net> | 2007-06-29 06:58:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-29 06:58:07 +0000 |
commit | eb296b2c957f574334fae2aefd8b863cf7631769 (patch) | |
tree | 57a546f8c61a81b7088b23b9fcd92a5b9d578e9f /libs/ardour/buffer_set.cc | |
parent | 44867662a3d020e042714d1c5e948b8c3afea941 (diff) |
Reduce overhead of multi-type-ness (last Summer's SoC):
Use uint32_t instead of size_t counts (halves size of ChanCount on 64-bit).
Shift DataType values down to eliminate subtraction every index of a ChanCount or *Set.
Allow using DataType directly as an array index (prettier/terser).
Fix some mixed spaces/tabs in file comment headers.
git-svn-id: svn://localhost/ardour2/trunk@2082 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/buffer_set.cc')
-rw-r--r-- | libs/ardour/buffer_set.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc index 24af224845..2206b8885b 100644 --- a/libs/ardour/buffer_set.cc +++ b/libs/ardour/buffer_set.cc @@ -67,7 +67,7 @@ BufferSet::attach_buffers(PortSet& ports) for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { _buffers.push_back(BufferVec()); - BufferVec& v = _buffers[(*t).to_index()]; + BufferVec& v = _buffers[*t]; for (PortSet::iterator p = ports.begin(*t); p != ports.end(*t); ++p) { assert(p->type() == *t); @@ -97,13 +97,13 @@ void BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capacity) { assert(type != DataType::NIL); - assert(type.to_index() < _buffers.size()); + assert(type < _buffers.size()); if (num_buffers == 0) return; // The vector of buffers of the type we care about - BufferVec& bufs = _buffers[type.to_index()]; + BufferVec& bufs = _buffers[type]; // If we're a mirror just make sure we're ok if (_is_mirror) { @@ -146,7 +146,7 @@ size_t BufferSet::buffer_capacity(DataType type) const { assert(_available.get(type) > 0); - return _buffers[type.to_index()][0]->capacity(); + return _buffers[type][0]->capacity(); } // FIXME: make 'in' const |