2 ms·
Bikeshed time! I feel that the bool adds complexity to the logic. I would rather just use an actual comment to indicate what the condition is for: int padded
by scott_s 12y ago
Bikeshed time! I feel that the bool adds complexity to the logic. I would rather just use an actual comment to indicate what the condition is for:
int padded_size(int size)
{
int remainder = size % 2048;
// do we even need padding?
if (remainder == 0) {
return size;
}
return size + (2048 - remainder);
}