[erlang-questions] Request feedback on example project

Björn Gustavsson bjorn@REDACTED
Wed Feb 3 08:33:28 CET 2016


On Wed, Feb 3, 2016 at 8:10 AM, zxq9 <zxq9@REDACTED> wrote:
>
> There should never be a chance where 0 > V because V is
> extracted from a match on bits:
>
>     version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>})
>             when V > 0 andalso V < 6 ->

V > 0 means that V can't be 0...

> Therefore the following should be just as safe:
>
>     version({uuid, <<_:48, V:4, _:12, 2:2, _:62>>})
>             when V < 6 ->

... therefore the modification is not safe.

/Björn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list