aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-12-16 17:31:11 +0100
committerGitHub <noreply@github.com>2023-12-16 17:31:11 +0100
commitb0b6d9f21fe77fb7b46469529bf252f0dbcaa551 (patch)
tree612562863dbf4364e41e2086b701b92761c18e72 /libqpdf/QPDFWriter.cc
parentd7a364b882be44c93dc4a843bcca2ae63e805c2c (diff)
parent368666899fe24885fbe05ea03688fa985645ebd9 (diff)
downloadqpdf-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.cc5
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();