diff options
author | Thorbjørn Lund Martsum <tmartsum@gmail.com> | 2012-10-01 06:42:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-27 07:35:48 +0200 |
commit | cfc3eeea1b3fbf31998deef65fb01214d44d36fd (patch) | |
tree | 5ecc5d35ccb932179e959e591643d119304d0169 /src/corelib/tools/qmap.h | |
parent | 67a0f546c507d4113de895df297815adcb5d489e (diff) |
QMap - use hint on insert in QMap::toStdMap
Giving the std-map a hint (normally) improves insert performance.
There seems to be no reason not to provide this hint.
Change-Id: I4344607ebf54574a3ae9666d87a41a3c14762361
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r-- | src/corelib/tools/qmap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 642cf82f08..0e726e8394 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -946,7 +946,7 @@ Q_OUTOFLINE_TEMPLATE std::map<Key, T> QMap<Key, T>::toStdMap() const const_iterator it = end(); while (it != begin()) { --it; - map.insert(std::pair<Key, T>(it.key(), it.value())); + map.insert(map.begin(), std::pair<Key, T>(it.key(), it.value())); } return map; } |