Skip to content

Commit

Permalink
Use stdlib function rather than rolling our own.
Browse files Browse the repository at this point in the history
  • Loading branch information
ltratt committed Jan 22, 2025
1 parent a5034b9 commit 23691c5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ykrt/src/compile/jitc_yk/aot_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1613,13 +1613,7 @@ impl IntegerTy {
/// Padding for alignment is not included.
#[cfg(test)]
pub(crate) fn byte_size(&self) -> usize {
let bits = self.bitw();
let mut ret = bits / 8;
// If it wasn't an exactly byte-sized thing, round up to the next byte.
if bits % 8 != 0 {
ret += 1;
}
usize::try_from(ret).unwrap()
usize::try_from(self.bitw().div_ceil(8)).unwrap()
}

/// Format a constant integer value that is of the type described by `self`.
Expand Down

0 comments on commit 23691c5

Please sign in to comment.