1
Fork 0

Add is_null helper

This is cheaper than creating a null-`ScalarInt` and comparing
and then just throwing it away.
This commit is contained in:
oli 2020-11-01 17:17:04 +00:00
parent 0347ca7d02
commit f03b18b99b
2 changed files with 7 additions and 2 deletions

View file

@ -188,6 +188,11 @@ impl ScalarInt {
Self { data: 0, size: size.bytes() as u8 }
}
#[inline]
pub fn is_null(self) -> bool {
self.data == 0
}
pub(crate) fn ptr_sized_op<'tcx>(
self,
dl: &TargetDataLayout,