From cfc3eeea1b3fbf31998deef65fb01214d44d36fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Mon, 1 Oct 2012 06:42:28 +0200 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/tools/qmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qmap.h') 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 QMap::toStdMap() const const_iterator it = end(); while (it != begin()) { --it; - map.insert(std::pair(it.key(), it.value())); + map.insert(map.begin(), std::pair(it.key(), it.value())); } return map; } -- cgit v1.2.3