Skip to content

Commit

Permalink
Use specialized erase_begin to remove read data from sequential buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
f1xpl committed Mar 28, 2018
1 parent 4623f6b commit f32b010
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/autoapp/Projection/SequentialBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ qint64 SequentialBuffer::readData(char *data, qint64 maxlen)

const auto len = std::min<size_t>(maxlen, data_.size());
std::copy(data_.begin(), data_.begin() + len, data);
data_.erase(data_.begin(), data_.begin() + len);
data_.erase_begin(len);

return len;
}

Expand Down

0 comments on commit f32b010

Please sign in to comment.