diff --git a/libqpdf/NNTree.cc b/libqpdf/NNTree.cc index 8a0bbbc..78098d6 100644 --- a/libqpdf/NNTree.cc +++ b/libqpdf/NNTree.cc @@ -337,11 +337,7 @@ NNTreeIterator::split(Dictionary to_split, std::list::iterator pare std::list::iterator NNTreeIterator::lastPathElement() { - auto result = path.end(); - if (!path.empty()) { - --result; - } - return result; + return path.empty() ? path.end() : std::prev(path.end()); } void