]> git.lizzy.rs Git - rust.git/commit
Avoid ptrtoint when checking if a pointer is null
authorBjörn Steinbrink <bsteinbr@gmail.com>
Mon, 2 Feb 2015 20:45:49 +0000 (21:45 +0100)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Wed, 18 Feb 2015 13:04:46 +0000 (14:04 +0100)
commit52b5150cfd3dfcdf518675e9073f03e061a63a53
treef151c225b58184958d90227f805e383903f0db91
parentdfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5
Avoid ptrtoint when checking if a pointer is null

Casting the pointer to an integer requires a ptrtoint, while casting 0
to a pointer is directly folded to a `null` value.
src/libcore/ptr.rs