summaryrefslogtreecommitdiff
path: root/qt4
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2008-12-20 22:25:55 +0100
committerPino Toscano <pino@kde.org>2008-12-20 22:25:55 +0100
commitc976770c64e4c991fff27e413414473583b6fd86 (patch)
treeefca506c42186b382644fe7fccb4506fb47c1272 /qt4
parent944f6049a50eb3be9fb29174d67adc4ad1d0b9fe (diff)
[Qt4] use QHash instead of QMap where applicable
using a hash table instead of a map mapes lookup faster; in these cases we don't need the sorting a map gives
Diffstat (limited to 'qt4')
-rw-r--r--qt4/src/poppler-page.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index 50c733ed..bef5d0a8 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -22,6 +22,7 @@
#include <poppler-qt4.h>
+#include <QtCore/QHash>
#include <QtCore/QMap>
#include <QtCore/QVarLengthArray>
#include <QtGui/QImage>
@@ -365,7 +366,7 @@ QList<TextBox*> Page::textList(Rotation rotate) const
return output_list;
}
- QMap<TextWord *, TextBox*> wordBoxMap;
+ QHash<TextWord *, TextBox*> wordBoxMap;
for (int i = 0; i < word_list->getLength(); i++) {
TextWord *word = word_list->get(i);
@@ -502,7 +503,7 @@ QList<Annotation*> Page::annotations() const
// ID to Annotation/PopupWindow maps
QMap< int, Annotation * > annotationsMap;
- QMap< AnnotPopup *, PopupWindow * > popupsMap;
+ QHash< AnnotPopup *, PopupWindow * > popupsMap;
// lists of Windows and Revisions that needs resolution
QLinkedList< ResolveRevision > resolveRevList;
QLinkedList< ResolveWindow > resolvePopList;
@@ -1171,7 +1172,7 @@ QList<Annotation*> Page::annotations() const
}
// clear data
- QMap< AnnotPopup *, PopupWindow * >::Iterator dIt = popupsMap.begin(), dEnd = popupsMap.end();
+ QHash< AnnotPopup *, PopupWindow * >::Iterator dIt = popupsMap.begin(), dEnd = popupsMap.end();
for ( ; dIt != dEnd; ++dIt )
{
PopupWindow * p = dIt.value();