aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/SparseOHArray.cc
blob: c830d035c1702e763983b3a1adebd59e06cd548a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <qpdf/SparseOHArray.hh>

SparseOHArray
SparseOHArray::copy()
{
    SparseOHArray result;
    result.n_elements = this->n_elements;
    for (auto const& element: this->elements) {
        auto value = element.second;
        result.elements[element.first] =
            value->getObjGen().isIndirect() ? value : value->copy();
    }
    return result;
}