diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-29 10:33:16 -0800 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-15 17:00:04 -0800 |
| commit | f4d49910be81419cd951c602cca34f368b179652 (patch) | |
| tree | b5824570ddbbf172dde309504166fbb69a2aa41e /src/corelib/serialization/qjsonobject.cpp | |
| parent | afe2f80c6a53e57f14e29196c08d35659b9da978 (diff) | |
QCborValueConstRef: optimize to{Integer,Bool,Double,String,ByteArray}()
The initial implementation from Qt 5.13 simply created a QCborValue and
then called the equivalent function on that result. For integrals and
double where the QCborValue matched the asked type, the cost was minimal
anyway. For the other types and when the type didn't match, this
resulted in up/down the reference counter in QCborContainerPrivate and
an out-of-line call to the destructor.
This improves the performance for code like:
for (QCborValue v : array) {
if (v.toString() == x) {
doSomething();
}
}
Change-Id: I5e52dc5b093c43a3b678fffd16b6022da4e2d446
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/serialization/qjsonobject.cpp')
0 files changed, 0 insertions, 0 deletions
