Android: Reserve space for the QVarLengthArray, so we can use append
When the QVarLengthArray was initialized with a size then append would add to the end of that. Therefore we need to use reserve to get the desired effect. Task-number: QTBUG-64905 Change-Id: Ia1ebeb26cd31bc5e92bd7f81079506a266b845bf Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>bb10
parent
81a88639ac
commit
87efdd8c7f
|
|
@ -106,7 +106,8 @@ namespace QtAndroidAccessibility
|
|||
QAccessibleInterface *iface = interfaceFromId(objectId);
|
||||
if (iface && iface->isValid()) {
|
||||
const int childCount = iface->childCount();
|
||||
QVarLengthArray<jint, 8> ifaceIdArray(childCount);
|
||||
QVarLengthArray<jint, 8> ifaceIdArray;
|
||||
ifaceIdArray.reserve(childCount);
|
||||
for (int i = 0; i < childCount; ++i) {
|
||||
QAccessibleInterface *child = iface->child(i);
|
||||
if (child && child->isValid())
|
||||
|
|
|
|||
Loading…
Reference in New Issue