Merge pull request #53 from f1xpl/feature/performance_improvements

Use specialized erase_begin to remove read data from sequential buffer
pull/61/head
Michal Szwaj 2018-03-28 17:21:00 +02:00 committed by GitHub
commit 9efcd9bd46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}