Using flat map instead of std::set, optimalization

This commit is contained in:
Jakub Melka
2018-11-25 17:57:39 +01:00
parent 89d4ee606b
commit 670a260265
8 changed files with 219 additions and 46 deletions

View File

@@ -162,7 +162,7 @@ std::vector<PDFXRefTable::Entry> PDFXRefTable::getOccupiedEntries() const
const PDFXRefTable::Entry& PDFXRefTable::getEntry(PDFObjectReference reference) const
{
// We must also check generation number here. For this reason, we compare references of the entry at given position.
if (reference.objectNumber >= 0 && reference.objectNumber < m_entries.size() && m_entries[reference.objectNumber].reference == reference)
if (reference.objectNumber >= 0 && reference.objectNumber < static_cast<PDFInteger>(m_entries.size()) && m_entries[reference.objectNumber].reference == reference)
{
return m_entries[reference.objectNumber];
}