From a1b2c474fd3c82d735c64deccf5bf3d2c29ef0f4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 3 Dec 2021 13:37:25 -0800 Subject: [PATCH] QPluginParsedMetaData: avoid the indirection through QCborMap value[x] is the same as value.toMap()[x] but avoids the refcounting up and down just to call the operator[] overload. We're calling the operator[] overload taking an integer, which means it could match an array, but we know the data member won't be one because of how QPluginParsedMetaData::parse() parses. Change-Id: I2cffe62afda945079b63fffd16bd5c690b2bfee4 Reviewed-by: Edward Welbourne --- src/corelib/plugin/qfactoryloader_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index 633cf0a9161..e678f4afb41 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -90,7 +90,7 @@ public: // if data is not a map, toMap() returns empty, so shall these functions QCborMap toCbor() const { return data.toMap(); } - QCborValue value(QtPluginMetaDataKeys k) const { return toCbor()[int(k)]; } + QCborValue value(QtPluginMetaDataKeys k) const { return data[int(k)]; } }; class QFactoryLoaderPrivate;