GHash/EdgeHash: avoid NULL check on iterator init

This commit is contained in:
Campbell Barton 2014-08-07 11:19:55 +10:00
parent ea30641d90
commit 1b6864752f
2 changed files with 4 additions and 4 deletions

View File

@ -570,12 +570,12 @@ void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
ghi->curEntry = NULL;
ghi->curBucket = UINT_MAX; /* wraps to zero */
if (gh->nentries) {
while (!ghi->curEntry) {
do {
ghi->curBucket++;
if (UNLIKELY(ghi->curBucket == ghi->gh->nbuckets))
break;
ghi->curEntry = ghi->gh->buckets[ghi->curBucket];
}
} while (!ghi->curEntry);
}
}

View File

@ -463,14 +463,14 @@ void BLI_edgehashIterator_init(EdgeHashIterator *ehi, EdgeHash *eh)
ehi->curEntry = NULL;
ehi->curBucket = UINT_MAX; /* wraps to zero */
if (eh->nentries) {
while (!ehi->curEntry) {
do {
ehi->curBucket++;
if (UNLIKELY(ehi->curBucket == ehi->eh->nbuckets)) {
break;
}
ehi->curEntry = ehi->eh->buckets[ehi->curBucket];
}
} while (!ehi->curEntry);
}
}