On 08.09.2012 03:59, Peter Samuelson wrote: >> for (; len > 0; ++data, --len) >> - if (*data < 0) >> - return data; >> + if (*data < 0 || *data >= 0x80) >> + return data; > A reasonable compiler will collapse it anyway, but this is shorter and > more direct: > > if (*data & 0x80)
Also less obvious to the casual reader. Let's just leave it to reasonable compilers to optimize the code for us. I can live with unreasonable compilers causing the CPU to do more grunt work. :) -- Brane -- Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/download