diff options
author | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2023-12-16 17:31:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-16 17:31:11 +0100 |
commit | b0b6d9f21fe77fb7b46469529bf252f0dbcaa551 (patch) | |
tree | 612562863dbf4364e41e2086b701b92761c18e72 /libqpdf/QPDFWriter.cc | |
parent | d7a364b882be44c93dc4a843bcca2ae63e805c2c (diff) | |
parent | 368666899fe24885fbe05ea03688fa985645ebd9 (diff) | |
download | qpdf-b0b6d9f21fe77fb7b46469529bf252f0dbcaa551.tar.zst |
Merge pull request #1067 from m-holger/pl_buff
Reduce copying of Buffer contents
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r-- | libqpdf/QPDFWriter.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index db3b42e0..664ea5ff 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -1579,10 +1579,7 @@ QPDFWriter::unparseObject( m->cur_data_key.length()); pl.writeString(val); pl.finish(); - auto buf = bufpl.getBufferSharedPointer(); - val = QPDF_String( - std::string(reinterpret_cast<char*>(buf->getBuffer()), buf->getSize())) - .unparse(true); + val = QPDF_String(bufpl.getString()).unparse(true); } else { auto tmp_ph = QUtil::make_unique_cstr(val); char* tmp = tmp_ph.get(); |