Skip to content

Commit

Permalink
Remove unnecessary if expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
azteca1998 committed Dec 27, 2024
1 parent f225bbc commit f0ed96b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/libfuncs/bounded_int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,12 @@ fn build_trim<'ctx, 'this>(
// since we're returning a `BoundedInt` we need to offset its internal representation
// accordingly.
let value = if info.trimmed_value <= BigInt::ZERO {
let offset = if info.trimmed_value == BigInt::ZERO {
entry.const_int_from_type(context, location, 1, value.r#type())?
} else {
entry.const_int_from_type(context, location, &info.trimmed_value + 1, value.r#type())?
};
let offset = entry.const_int_from_type(
context,
location,
&info.trimmed_value + 1,
value.r#type(),
)?;

entry.append_op_result(arith::subi(value, offset, location))?
} else {
Expand Down

0 comments on commit f0ed96b

Please sign in to comment.