*/
template <typename T>
void* SkTileGridNextDatum(SkTDArray<void*>** tileData, SkTDArray<int>& tileIndices) {
- bool haveVal = false;
- T* minVal;
+ T* minVal = NULL;
int tileCount = tileIndices.count();
// Find the next Datum
for (int tile = 0; tile < tileCount; ++tile) {
int pos = tileIndices[tile];
if (pos != SkTileGrid::kTileFinished) {
T* candidate = (T*)(*tileData[tile])[pos];
- if (!haveVal || (*candidate) < (*minVal)) {
+ if (NULL == minVal || (*candidate) < (*minVal)) {
minVal = candidate;
- haveVal = true;
}
}
}
// Increment indices past the next datum
- if (haveVal) {
+ if (minVal != NULL) {
for (int tile = 0; tile < tileCount; ++tile) {
int pos = tileIndices[tile];
if (pos != SkTileGrid::kTileFinished && (*tileData[tile])[pos] == minVal) {