GHash/EdgeHash: avoid NULL check on iterator init
This commit is contained in:
parent
ea30641d90
commit
1b6864752f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue