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:
parent
0347ca7d02
commit
f03b18b99b
2 changed files with 7 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue