mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Merge branch 'trunk' into dec-to-string
This commit is contained in:
commit
7f52e46c69
93 changed files with 492 additions and 359 deletions
|
@ -265,7 +265,7 @@ fn mul_and_decimalize(a: u128, b: u128) i128 {
|
|||
// floor(2^315/10^18) is 66749594872528440074844428317798503581334516323645399060845050244444366430645
|
||||
|
||||
// Add 1.
|
||||
// This can't overflow because the intial numbers are only 127bit due to removing the sign bit.
|
||||
// This can't overflow because the initial numbers are only 127bit due to removing the sign bit.
|
||||
var overflowed = @addWithOverflow(u128, lhs_lo, 1, &lhs_lo);
|
||||
lhs_hi = blk: {
|
||||
if (overflowed) {
|
||||
|
|
|
@ -20,13 +20,9 @@ const Slot = packed enum(u8) {
|
|||
PreviouslyFilled,
|
||||
};
|
||||
|
||||
const MaybeIndexTag = enum {
|
||||
index, not_found
|
||||
};
|
||||
const MaybeIndexTag = enum { index, not_found };
|
||||
|
||||
const MaybeIndex = union(MaybeIndexTag) {
|
||||
index: usize, not_found: void
|
||||
};
|
||||
const MaybeIndex = union(MaybeIndexTag) { index: usize, not_found: void };
|
||||
|
||||
fn nextSeed(seed: u64) u64 {
|
||||
// TODO is this a valid way to get a new seed? are there better ways?
|
||||
|
@ -795,9 +791,7 @@ pub fn dictWalk(
|
|||
|
||||
caller(data, key, value, b2, b1);
|
||||
|
||||
const temp = b1;
|
||||
b2 = b1;
|
||||
b1 = temp;
|
||||
std.mem.swap([*]u8, &b1, &b2);
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
|
|
@ -542,9 +542,7 @@ pub fn listWalk(
|
|||
const element = source_ptr + i * element_width;
|
||||
caller(data, element, b2, b1);
|
||||
|
||||
const temp = b1;
|
||||
b2 = b1;
|
||||
b1 = temp;
|
||||
std.mem.swap([*]u8, &b1, &b2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -591,9 +589,7 @@ pub fn listWalkBackwards(
|
|||
const element = source_ptr + i * element_width;
|
||||
caller(data, element, b2, b1);
|
||||
|
||||
const temp = b1;
|
||||
b2 = b1;
|
||||
b1 = temp;
|
||||
std.mem.swap([*]u8, &b1, &b2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue