<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 6, 2013 at 9:56 AM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 6/5/2013 5:59 PM, Sean Silva wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  +// Can't find this anywhere else in the codebase (clang has one, but it has<br>
+// some baggage). Deduplicate as required.<br>
+static bool isHexDigit(uint8_t C) {<br>
+  return ('0' <= C && C <= '9') ||<br>
+         ('A' <= C && C <= 'F') ||<br>
+         ('a' <= C && C <= 'f');<br>
+}<br>
+<br>
</blockquote></div>
Can this be inlined in the code using it ? Found only one use.<br></blockquote><div><br></div><div style>I couldn't find a suitable function in the codebase, but since this seemed like common functionality that was sure to exist somewhere, my goal here was to indicate the code's intent, so that it would be easy to identify and replace with common functionality by someone who knew where that functionality was (it seems like my plan worked, with d0k suggesting isxdigit).</div>
<div style><br></div><div style>Also, factoring out predicates like this is generally good practice for readability. The compiler will happily inline it.</div><div style><br></div><div style>-- Sean Silva</div></div></div>
</div>