mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Change while loops
This commit is contained in:
parent
73454b06a2
commit
6e2ac14c23
1 changed files with 2 additions and 6 deletions
|
@ -1439,22 +1439,18 @@ QStringList Avatar::getJointNames() const {
|
||||||
withValidJointIndicesCache([&]() {
|
withValidJointIndicesCache([&]() {
|
||||||
// find out how large the vector needs to be
|
// find out how large the vector needs to be
|
||||||
int maxJointIndex = -1;
|
int maxJointIndex = -1;
|
||||||
QHash<QString, int>::const_iterator k = _modelJointIndicesCache.constBegin();
|
for (auto k = _modelJointIndicesCache.constBegin(); k != _modelJointIndicesCache.constEnd(); k++) {
|
||||||
while (k != _modelJointIndicesCache.constEnd()) {
|
|
||||||
int index = k.value();
|
int index = k.value();
|
||||||
if (index > maxJointIndex) {
|
if (index > maxJointIndex) {
|
||||||
maxJointIndex = index;
|
maxJointIndex = index;
|
||||||
}
|
}
|
||||||
++k;
|
|
||||||
}
|
}
|
||||||
// iterate through the hash and put joint names
|
// iterate through the hash and put joint names
|
||||||
// into the vector at their indices
|
// into the vector at their indices
|
||||||
QVector<QString> resultVector(maxJointIndex+1);
|
QVector<QString> resultVector(maxJointIndex+1);
|
||||||
QHash<QString, int>::const_iterator i = _modelJointIndicesCache.constBegin();
|
for (auto i = _modelJointIndicesCache.constBegin(); i != _modelJointIndicesCache.constEnd(); i++) {
|
||||||
while (i != _modelJointIndicesCache.constEnd()) {
|
|
||||||
int index = i.value();
|
int index = i.value();
|
||||||
resultVector[index] = i.key();
|
resultVector[index] = i.key();
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
// convert to QList and drop out blanks
|
// convert to QList and drop out blanks
|
||||||
result = resultVector.toList();
|
result = resultVector.toList();
|
||||||
|
|
Loading…
Reference in a new issue