diff options
author | Ivan Komissarov <ABBAPOH@gmail.com> | 2019-11-24 16:44:20 +0900 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2019-12-02 13:45:19 +0000 |
commit | a8198cce40983d2e3d9385bb7cbc492ea9196026 (patch) | |
tree | f33915684717eb4744a64395e0886573778d8429 /src/lib/corelib/language/moduleloader.cpp | |
parent | 7606963ffd637aa4a410f931621af3bb982899b7 (diff) |
Fix 'modernize-use-emplace' warnings
std::vector::emplace_back creates an object in a vector and allows to
avoid creating temporary object that is than moved into a vector. This
simplifies code a bit as it is not necessary to call std::make_pair or
use uniform initialization to create a temporary object
Change-Id: I0c5500a818f78d07bc753e25f529c06762cb615c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/language/moduleloader.cpp')
-rw-r--r-- | src/lib/corelib/language/moduleloader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index 1aeca0411..ed507b990 100644 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -3228,7 +3228,7 @@ Item *ModuleLoader::getModulePrototype(ProductContext *productContext, } } Item * const module = loadItemFromFile(filePath, CodeLocation()); - prototypeList.push_back(std::make_pair(module, productContext->profileName)); + prototypeList.emplace_back(module, productContext->profileName); if (module->type() != ItemType::Module) { qCDebug(lcModuleLoader).nospace() << "Alleged module " << fullModuleName << " has type '" @@ -3328,7 +3328,7 @@ static std::vector<std::pair<QualifiedId, ItemValuePtr>> instanceItemProperties( if (itemValue->item()->type() == ItemType::ModulePrefix) f(itemValue->item()); else - result.push_back(std::make_pair(name, itemValue)); + result.emplace_back(name, itemValue); name.removeLast(); } }; |