From 3ca763faf015958b8aed212efabbfac128adccee Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 21 Mar 2015 17:52:18 +0100 Subject: Replace copy loop by std::copy --- src/VLCInput.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/VLCInput.cpp') diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index a370c78..99f86f1 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -186,9 +186,8 @@ ssize_t VLCInput::m_read(uint8_t* buf, size_t length) boost::mutex::scoped_lock lock(m_queue_mutex); if (m_queue.size() >= length) { - for (size_t i = 0; i < length; i++) { - buf[i] = m_queue[i]; - } + std::copy(m_queue.begin(), m_queue.begin() + length, buf); + m_queue.erase(m_queue.begin(), m_queue.begin() + length); return length; -- cgit v1.2.3