<div dir="ltr"><div><span style="color:rgb(80,0,80);font-size:13px"><br></span></div><span style="color:rgb(80,0,80);font-size:13px">version({uuid, <<_:48, 0:4, _:12, 2:2, _:62>>}) -></span><br><div><span style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:13px">version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>}) when V < 6 -></span><span style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:13px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 3, 2016 at 1:03 PM, Björn Gustavsson <span dir="ltr"><<a href="mailto:bjorn@erlang.org" target="_blank">bjorn@erlang.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Feb 3, 2016 at 8:10 AM, zxq9 <<a href="mailto:zxq9@zxq9.com">zxq9@zxq9.com</a>> wrote:<br>
><br>
> There should never be a chance where 0 > V because V is<br>
> extracted from a match on bits:<br>
><br>
> version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>})<br>
> when V > 0 andalso V < 6 -><br>
<br>
</span>V > 0 means that V can't be 0...<br>
<span class=""><br>
> Therefore the following should be just as safe:<br>
><br>
> version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>})<br>
> when V < 6 -><br>
<br>
</span>... therefore the modification is not safe.<br>
<span class="im HOEnZb"><br>
/Björn<br>
<br>
--<br>
Björn Gustavsson, Erlang/OTP, Ericsson AB<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>