diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-12-19 20:20:36 +0100 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-12-31 20:37:35 +0100 |
commit | d67a54ae93640f784a03df5d07404df13b1b297a (patch) | |
tree | f0db36860634d0707143391b9bfbf1726dcf5914 /libqpdf/QPDF_Dictionary.cc | |
parent | 846504129f58a638ba481c4329187be8ebb20419 (diff) | |
download | qpdf-d67a54ae93640f784a03df5d07404df13b1b297a.tar.zst |
Tune parsing of dictionaries in QPDFParser::parse
Use move semantics for dictionary creation.
Diffstat (limited to 'libqpdf/QPDF_Dictionary.cc')
-rw-r--r-- | libqpdf/QPDF_Dictionary.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libqpdf/QPDF_Dictionary.cc b/libqpdf/QPDF_Dictionary.cc index 87d93a32..5349a2a8 100644 --- a/libqpdf/QPDF_Dictionary.cc +++ b/libqpdf/QPDF_Dictionary.cc @@ -9,6 +9,13 @@ QPDF_Dictionary::QPDF_Dictionary( { } +QPDF_Dictionary::QPDF_Dictionary( + std::map<std::string, QPDFObjectHandle>&& items) : + QPDFValue(::ot_dictionary, "dictionary"), + items(items) +{ +} + std::shared_ptr<QPDFObject> QPDF_Dictionary::create(std::map<std::string, QPDFObjectHandle> const& items) { @@ -16,6 +23,12 @@ QPDF_Dictionary::create(std::map<std::string, QPDFObjectHandle> const& items) } std::shared_ptr<QPDFObject> +QPDF_Dictionary::create(std::map<std::string, QPDFObjectHandle>&& items) +{ + return do_create(new QPDF_Dictionary(items)); +} + +std::shared_ptr<QPDFObject> QPDF_Dictionary::copy(bool shallow) { if (shallow) { |