3 ms·
I'd call this code out as unusual at the very least, particularly if this code appeared in a loop. In that case, I'd normally expect to use a for loop, where th
by dfabulich 8y ago
I'd call this code out as unusual at the very least, particularly if this code appeared in a loop. In that case, I'd normally expect to use a for loop, where the ++ operator appears only in the increment part of the loop declaration.
- a1369209993 8y agoUnusual, sure, but I've frequently seen/written code like: if(haveitem) buf[i++] = item; and if(haveitem) line[i++%nline] += sprintf(" %8i",item); seems like an obvious way to evenly distribute column-grouped data.
- watwut 8y agoIt can easily happen when you are iterating through list while updating another array with data from list (conditionally or doing computation or whatever). Pretty common case.