mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +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([&]() {
|
||||
// find out how large the vector needs to be
|
||||
int maxJointIndex = -1;
|
||||
QHash<QString, int>::const_iterator k = _modelJointIndicesCache.constBegin();
|
||||
while (k != _modelJointIndicesCache.constEnd()) {
|
||||
for (auto k = _modelJointIndicesCache.constBegin(); k != _modelJointIndicesCache.constEnd(); k++) {
|
||||
int index = k.value();
|
||||
if (index > maxJointIndex) {
|
||||
maxJointIndex = index;
|
||||
}
|
||||
++k;
|
||||
}
|
||||
// iterate through the hash and put joint names
|
||||
// into the vector at their indices
|
||||
QVector<QString> resultVector(maxJointIndex+1);
|
||||
QHash<QString, int>::const_iterator i = _modelJointIndicesCache.constBegin();
|
||||
while (i != _modelJointIndicesCache.constEnd()) {
|
||||
for (auto i = _modelJointIndicesCache.constBegin(); i != _modelJointIndicesCache.constEnd(); i++) {
|
||||
int index = i.value();
|
||||
resultVector[index] = i.key();
|
||||
++i;
|
||||
}
|
||||
// convert to QList and drop out blanks
|
||||
result = resultVector.toList();
|
||||
|
|
Loading…
Reference in a new issue