Re:In C++, is empty() faster than comparing the size with zero?
by mhh__ on Thursday October 28, 2021 @08:42PM
(#29033932)
That depends if the loop has side effects such that the optimization would be unsound.
The actual transformation is dead simple albeit possibly not that profitable on a modern processor that will be macro and micro fusing to hell and back
The actual transformation is dead simple albeit possibly not that profitable on a modern processor that will be macro and micro fusing to hell and back