Unverified Commit c1724d25 authored by Matthias Vallentin's avatar Matthias Vallentin Committed by GitHub

Merge pull request #779

Use insert for faster appending in xsputn
parents 4466c76f c1a9059d
......@@ -365,11 +365,7 @@ protected:
}
std::streamsize xsputn(const char_type* s, std::streamsize n) override {
// TODO: Do a performance analysis whether the current implementation based
// on copy_n is faster than these two statements:
// (1) container_.resize(container_.size() + n);
// (2) std::memcpy(this->pptr(), s, n * sizeof(char_type));
std::copy_n(s, n, std::back_inserter(container_));
container_.insert(container_.end(), s, s + n);
return n;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment