slightly cleaner strlen, also seems to compile to better code
authorRich Felker <dalias@aerifal.cx>
Thu, 27 Sep 2012 20:56:33 +0000 (16:56 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 27 Sep 2012 20:56:33 +0000 (16:56 -0400)
commit3f9ff1514e49b06c20a61af9ae9e52bd53b48d9a
tree697589451e3d75da05df6e2dd38fcdabf5b4a138
parent507faa63cb12571c14d66eb37dedbe6adbbf40a8
slightly cleaner strlen, also seems to compile to better code

testing with gcc 4.6.3 on x86, -Os, the old version does a duplicate
null byte check after the first loop. this is purely the compiler
being stupid, but the old code was also stupid and unintuitive in how
it expressed the check.
src/string/strlen.c