MOC: don't create unnecessary QByteArray copies
To avoid changing the ref count and the associated atomic operations. Change-Id: I4195383bc15b36be564909bbdbc0abebc3b00787 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
05e59e37c8
commit
3a1f4f718d
@ -903,7 +903,7 @@ QMultiMap<QByteArray, int> Generator::automaticPropertyMetaTypesHelper()
|
||||
QMultiMap<QByteArray, int> automaticPropertyMetaTypes;
|
||||
for (int i = 0; i < int(cdef->propertyList.size()); ++i) {
|
||||
const PropertyDef &p = cdef->propertyList.at(i);
|
||||
const QByteArray propertyType = p.type;
|
||||
const QByteArray &propertyType = p.type;
|
||||
if (registerableMetaType(propertyType) && !isBuiltinType(propertyType))
|
||||
automaticPropertyMetaTypes.insert(cxxTypeTag(p.typeTag) + propertyType, i);
|
||||
}
|
||||
@ -917,7 +917,7 @@ Generator::methodsWithAutomaticTypesHelper(const QList<FunctionDef> &methodList)
|
||||
for (int i = 0; i < methodList.size(); ++i) {
|
||||
const FunctionDef &f = methodList.at(i);
|
||||
for (int j = 0; j < f.arguments.size(); ++j) {
|
||||
const QByteArray argType = f.arguments.at(j).normalizedType;
|
||||
const QByteArray &argType = f.arguments.at(j).normalizedType;
|
||||
if (registerableMetaType(argType) && !isBuiltinType(argType))
|
||||
methodsWithAutomaticTypes[i].insert(argType, j);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user