Use scope parameters for FixedRingBuffer as appropriate.

This commit is contained in:
Sönke Ludwig 2017-02-22 19:51:15 +01:00
parent 40713db075
commit 6f78310f26

View file

@ -362,7 +362,7 @@ struct FixedRingBuffer(T, size_t N = 0, bool INITIALIZE = true) {
} }
void put()(T itm) { assert(m_fill < m_buffer.length); m_buffer[mod(m_start + m_fill++)] = itm; } void put()(T itm) { assert(m_fill < m_buffer.length); m_buffer[mod(m_start + m_fill++)] = itm; }
void put(TC : T)(TC[] itms) void put(TC : T)(scope TC[] itms)
{ {
if( !itms.length ) return; if( !itms.length ) return;
assert(m_fill+itms.length <= m_buffer.length); assert(m_fill+itms.length <= m_buffer.length);
@ -415,7 +415,7 @@ struct FixedRingBuffer(T, size_t N = 0, bool INITIALIZE = true) {
else return m_buffer[mod(m_start+m_fill) .. m_start]; else return m_buffer[mod(m_start+m_fill) .. m_start];
} }
void read(T[] dst) void read(scope T[] dst)
{ {
assert(dst.length <= length); assert(dst.length <= length);
if( !dst.length ) return; if( !dst.length ) return;