On Oct 17, 2012, at 9:50 AM, Aric Stewart wrote:
if (iconDirEntries[i].wBitCount >= best[slot].maxBits)
if (((best[slot].maxBits && !scaled) || (!best[slot].maxBits) || (scaled && best[slot].scaled)) && (iconDirEntries[i].wBitCount >= best[slot].maxBits || (!scaled && best[slot].scaled)))
This could be more clearly written as:
if ((!scaled || !best[slot].maxBits || best[slot].scaled) && (iconDirEntries[i].wBitCount >= best[slot].maxBits || (!scaled && best[slot].scaled)))
or even:
if (scaled && best[slot].maxBits && !best[slot].scaled) continue; /* don't replace unscaled with scaled */ if (iconDirEntries[i].wBitCount >= best[slot].maxBits || (!scaled && best[slot].scaled))
That is, your left side of the outer && has redundancies and all the negatives make it hard to penetrate.
-Ken