mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Prefer and
and or
for boolean operators
This commit is contained in:
parent
d9d3fc74fc
commit
a292e070d4
35 changed files with 189 additions and 282 deletions
|
@ -1284,30 +1284,6 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
|||
rhs_layout,
|
||||
)
|
||||
}
|
||||
And => {
|
||||
// The (&&) operator
|
||||
arguments!(lhs_arg, rhs_arg);
|
||||
|
||||
let bool_val = env.builder.new_build_and(
|
||||
lhs_arg.into_int_value(),
|
||||
rhs_arg.into_int_value(),
|
||||
"bool_and",
|
||||
);
|
||||
|
||||
BasicValueEnum::IntValue(bool_val)
|
||||
}
|
||||
Or => {
|
||||
// The (||) operator
|
||||
arguments!(lhs_arg, rhs_arg);
|
||||
|
||||
let bool_val = env.builder.new_build_or(
|
||||
lhs_arg.into_int_value(),
|
||||
rhs_arg.into_int_value(),
|
||||
"bool_or",
|
||||
);
|
||||
|
||||
BasicValueEnum::IntValue(bool_val)
|
||||
}
|
||||
Not => {
|
||||
// The (!) operator
|
||||
arguments!(arg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue