m_backingBuffer can not be moved since it is a member variabele and only rvalues can be moved. returning a 'const Lines&' here might be an performance improvement, however, tests reveiled no measureable difference.
| 34 | // m_backingBuffer can not be moved since it is a member variabele and only rvalues can be moved. |
| 35 | // returning a 'const Lines&' here might be an performance improvement, however, tests reveiled no measureable difference. |
| 36 | Lines VectorLineBuffer::GetLines() |
| 37 | { |
| 38 | // the swap trick used here is very important to unblock the calling process asap. |
| 39 | m_backingBuffer.clear(); |
| 40 | { |
| 41 | std::unique_lock<std::mutex> lock(m_linesMutex); |
| 42 | m_buffer.swap(m_backingBuffer); |
| 43 | } |
| 44 | return m_backingBuffer; |
| 45 | } |
| 46 | |
| 47 | bool VectorLineBuffer::Empty() const |
| 48 | { |
nothing calls this directly
no outgoing calls
no test coverage detected