diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-06-22 10:04:04 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-07-31 16:54:23 +0200 |
commit | 13c90a0a752c6f67a4fb4078f190505b0c2c46d7 (patch) | |
tree | cbdb22ba536722e3c5440ffe08812b0b2167d08b /src/corelib/tools/qset.qdoc | |
parent | 46ec92dad0f71c8d5e3260a67321d82054ea607e (diff) |
Document that keys() and values() run in linear time
keys() and values() can be slower for large containers.
I ran into this recently when profiling, and was surprised that keys()
had to build the list of keys (by appending in a loop).
Pick-to: 5.15 5.12
Change-Id: I73215f5a917790236704ad7ef78cefc4a049cd89
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qset.qdoc')
-rw-r--r-- | src/corelib/tools/qset.qdoc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index eb6b542181..b6aae2c7ca 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -1093,6 +1093,10 @@ \include containers-range-constructor.qdocinc + This function creates a new list, in \l {linear time}. The time and memory + use that entails can be avoided by iterating from \l constBegin() to + \l constEnd(). + \sa fromList(), QList::fromSet() */ |