<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On 2009-09-24, at 18:56, OvermindDL1 wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Out of curiosity, what code in Clang is optimized by doing a pointer derefence then compare to 0, rather then just comparing two points directly?  Does not seem that efficient when laid out like that, which is why I am curious what code actually is helped by that pattern?<br></div></blockquote></div><div><br></div><div>Consider parsing an integer:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">// With NUL termination.</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">while ('0' <= *p && *p <= '9')<br><span class="Apple-tab-span" style="white-space:pre">  </span>n = n * 10 + (*p - '0');</blockquote><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">// Without.</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">while (p != e && '0' <= *p && *p <= '9')<br><span class="Apple-tab-span" style="white-space: pre; "> </span>n = n * 10 + (*p - '0');</blockquote><div><br></div><div>— Gordon</div></body></html>