diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-05-21 22:15:43 +0300 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-06-22 02:20:29 +0300 |
commit | 17df4bf52847cb38765a6318d411218ecee84c08 (patch) | |
tree | 9bd6001d67e44ad87b160e74039ef20f9767c990 /src/tools/moc | |
parent | cfc098253af9f6777df346aeb4b672fe998e5a2c (diff) |
Moc: use a std::initializer_list<QList *> instead of copying
No need to copy the 3 QLists to iterate over them.
Change-Id: Id0fc7d39012bdaa78e51b1153565df77c7fb889a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/generator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 128da4fd01..f295235c1c 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -539,9 +539,9 @@ void Generator::generateCode() // metatypes for all exposed methods // because we definitely printed something above, this section doesn't need comma control - for (const QList<FunctionDef> &methodContainer : - { cdef->signalList, cdef->slotList, cdef->methodList }) { - for (const FunctionDef &fdef : methodContainer) { + const auto allMethods = {&cdef->signalList, &cdef->slotList, &cdef->methodList}; + for (const QList<FunctionDef> *methodContainer : allMethods) { + for (const FunctionDef &fdef : *methodContainer) { fprintf(out, ",\n // method '%s'\n %s", fdef.name.constData(), stringForType(fdef.type.name, false).constData()); for (const auto &argument: fdef.arguments) |